More ScriptLib and dungeon fixes

* use GadgetWorktop for gadgetdata of the type SealGadget
* fix triggers being null in some cases
* implemented some more missing Scriptlib methods and fixed some bugs in others
* fixed delayed one time tasks never running
* dungeon system reworks:
  * load dungeonPassConfigData and add more fields to DungeonData
  * handle dungeon pass conditions
  * many dungeon handling refactorings
This commit is contained in:
hartie95 2022-09-18 11:40:50 +02:00
parent ca1e99130b
commit 2fbae5399d
63 changed files with 4343 additions and 346 deletions

View File

@ -0,0 +1,551 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DungeonSlipRevivePointActivateReq.proto
package emu.grasscutter.net.proto;
public final class DungeonSlipRevivePointActivateReqOuterClass {
private DungeonSlipRevivePointActivateReqOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface DungeonSlipRevivePointActivateReqOrBuilder extends
// @@protoc_insertion_point(interface_extends:DungeonSlipRevivePointActivateReq)
com.google.protobuf.MessageOrBuilder {
/**
* <code>uint32 slip_revive_point_id = 9;</code>
* @return The slipRevivePointId.
*/
int getSlipRevivePointId();
}
/**
* <pre>
* CmdId: 958
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonSlipRevivePointActivateReq}
*/
public static final class DungeonSlipRevivePointActivateReq extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:DungeonSlipRevivePointActivateReq)
DungeonSlipRevivePointActivateReqOrBuilder {
private static final long serialVersionUID = 0L;
// Use DungeonSlipRevivePointActivateReq.newBuilder() to construct.
private DungeonSlipRevivePointActivateReq(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DungeonSlipRevivePointActivateReq() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DungeonSlipRevivePointActivateReq();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DungeonSlipRevivePointActivateReq(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 72: {
slipRevivePointId_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.internal_static_DungeonSlipRevivePointActivateReq_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.internal_static_DungeonSlipRevivePointActivateReq_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq.class, emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq.Builder.class);
}
public static final int SLIP_REVIVE_POINT_ID_FIELD_NUMBER = 9;
private int slipRevivePointId_;
/**
* <code>uint32 slip_revive_point_id = 9;</code>
* @return The slipRevivePointId.
*/
@java.lang.Override
public int getSlipRevivePointId() {
return slipRevivePointId_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (slipRevivePointId_ != 0) {
output.writeUInt32(9, slipRevivePointId_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (slipRevivePointId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(9, slipRevivePointId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq)) {
return super.equals(obj);
}
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq other = (emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq) obj;
if (getSlipRevivePointId()
!= other.getSlipRevivePointId()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SLIP_REVIVE_POINT_ID_FIELD_NUMBER;
hash = (53 * hash) + getSlipRevivePointId();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* CmdId: 958
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonSlipRevivePointActivateReq}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:DungeonSlipRevivePointActivateReq)
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReqOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.internal_static_DungeonSlipRevivePointActivateReq_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.internal_static_DungeonSlipRevivePointActivateReq_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq.class, emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq.Builder.class);
}
// Construct using emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
slipRevivePointId_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.internal_static_DungeonSlipRevivePointActivateReq_descriptor;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq getDefaultInstanceForType() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq.getDefaultInstance();
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq build() {
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq buildPartial() {
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq result = new emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq(this);
result.slipRevivePointId_ = slipRevivePointId_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq) {
return mergeFrom((emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq other) {
if (other == emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq.getDefaultInstance()) return this;
if (other.getSlipRevivePointId() != 0) {
setSlipRevivePointId(other.getSlipRevivePointId());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int slipRevivePointId_ ;
/**
* <code>uint32 slip_revive_point_id = 9;</code>
* @return The slipRevivePointId.
*/
@java.lang.Override
public int getSlipRevivePointId() {
return slipRevivePointId_;
}
/**
* <code>uint32 slip_revive_point_id = 9;</code>
* @param value The slipRevivePointId to set.
* @return This builder for chaining.
*/
public Builder setSlipRevivePointId(int value) {
slipRevivePointId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 slip_revive_point_id = 9;</code>
* @return This builder for chaining.
*/
public Builder clearSlipRevivePointId() {
slipRevivePointId_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:DungeonSlipRevivePointActivateReq)
}
// @@protoc_insertion_point(class_scope:DungeonSlipRevivePointActivateReq)
private static final emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq();
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DungeonSlipRevivePointActivateReq>
PARSER = new com.google.protobuf.AbstractParser<DungeonSlipRevivePointActivateReq>() {
@java.lang.Override
public DungeonSlipRevivePointActivateReq parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DungeonSlipRevivePointActivateReq(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DungeonSlipRevivePointActivateReq> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DungeonSlipRevivePointActivateReq> getParserForType() {
return PARSER;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_DungeonSlipRevivePointActivateReq_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_DungeonSlipRevivePointActivateReq_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\'DungeonSlipRevivePointActivateReq.prot" +
"o\"A\n!DungeonSlipRevivePointActivateReq\022\034" +
"\n\024slip_revive_point_id\030\t \001(\rB\033\n\031emu.gras" +
"scutter.net.protob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_DungeonSlipRevivePointActivateReq_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_DungeonSlipRevivePointActivateReq_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_DungeonSlipRevivePointActivateReq_descriptor,
new java.lang.String[] { "SlipRevivePointId", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -0,0 +1,622 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DungeonSlipRevivePointActivateRsp.proto
package emu.grasscutter.net.proto;
public final class DungeonSlipRevivePointActivateRspOuterClass {
private DungeonSlipRevivePointActivateRspOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface DungeonSlipRevivePointActivateRspOrBuilder extends
// @@protoc_insertion_point(interface_extends:DungeonSlipRevivePointActivateRsp)
com.google.protobuf.MessageOrBuilder {
/**
* <code>uint32 slip_revive_point_id = 14;</code>
* @return The slipRevivePointId.
*/
int getSlipRevivePointId();
/**
* <code>int32 retcode = 4;</code>
* @return The retcode.
*/
int getRetcode();
}
/**
* <pre>
* CmdId: 970
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonSlipRevivePointActivateRsp}
*/
public static final class DungeonSlipRevivePointActivateRsp extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:DungeonSlipRevivePointActivateRsp)
DungeonSlipRevivePointActivateRspOrBuilder {
private static final long serialVersionUID = 0L;
// Use DungeonSlipRevivePointActivateRsp.newBuilder() to construct.
private DungeonSlipRevivePointActivateRsp(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DungeonSlipRevivePointActivateRsp() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DungeonSlipRevivePointActivateRsp();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DungeonSlipRevivePointActivateRsp(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 32: {
retcode_ = input.readInt32();
break;
}
case 112: {
slipRevivePointId_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.internal_static_DungeonSlipRevivePointActivateRsp_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.internal_static_DungeonSlipRevivePointActivateRsp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp.class, emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp.Builder.class);
}
public static final int SLIP_REVIVE_POINT_ID_FIELD_NUMBER = 14;
private int slipRevivePointId_;
/**
* <code>uint32 slip_revive_point_id = 14;</code>
* @return The slipRevivePointId.
*/
@java.lang.Override
public int getSlipRevivePointId() {
return slipRevivePointId_;
}
public static final int RETCODE_FIELD_NUMBER = 4;
private int retcode_;
/**
* <code>int32 retcode = 4;</code>
* @return The retcode.
*/
@java.lang.Override
public int getRetcode() {
return retcode_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (retcode_ != 0) {
output.writeInt32(4, retcode_);
}
if (slipRevivePointId_ != 0) {
output.writeUInt32(14, slipRevivePointId_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (retcode_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, retcode_);
}
if (slipRevivePointId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(14, slipRevivePointId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp)) {
return super.equals(obj);
}
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp other = (emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp) obj;
if (getSlipRevivePointId()
!= other.getSlipRevivePointId()) return false;
if (getRetcode()
!= other.getRetcode()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SLIP_REVIVE_POINT_ID_FIELD_NUMBER;
hash = (53 * hash) + getSlipRevivePointId();
hash = (37 * hash) + RETCODE_FIELD_NUMBER;
hash = (53 * hash) + getRetcode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* CmdId: 970
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonSlipRevivePointActivateRsp}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:DungeonSlipRevivePointActivateRsp)
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRspOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.internal_static_DungeonSlipRevivePointActivateRsp_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.internal_static_DungeonSlipRevivePointActivateRsp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp.class, emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp.Builder.class);
}
// Construct using emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
slipRevivePointId_ = 0;
retcode_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.internal_static_DungeonSlipRevivePointActivateRsp_descriptor;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp getDefaultInstanceForType() {
return emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp.getDefaultInstance();
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp build() {
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp buildPartial() {
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp result = new emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp(this);
result.slipRevivePointId_ = slipRevivePointId_;
result.retcode_ = retcode_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp) {
return mergeFrom((emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp other) {
if (other == emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp.getDefaultInstance()) return this;
if (other.getSlipRevivePointId() != 0) {
setSlipRevivePointId(other.getSlipRevivePointId());
}
if (other.getRetcode() != 0) {
setRetcode(other.getRetcode());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int slipRevivePointId_ ;
/**
* <code>uint32 slip_revive_point_id = 14;</code>
* @return The slipRevivePointId.
*/
@java.lang.Override
public int getSlipRevivePointId() {
return slipRevivePointId_;
}
/**
* <code>uint32 slip_revive_point_id = 14;</code>
* @param value The slipRevivePointId to set.
* @return This builder for chaining.
*/
public Builder setSlipRevivePointId(int value) {
slipRevivePointId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 slip_revive_point_id = 14;</code>
* @return This builder for chaining.
*/
public Builder clearSlipRevivePointId() {
slipRevivePointId_ = 0;
onChanged();
return this;
}
private int retcode_ ;
/**
* <code>int32 retcode = 4;</code>
* @return The retcode.
*/
@java.lang.Override
public int getRetcode() {
return retcode_;
}
/**
* <code>int32 retcode = 4;</code>
* @param value The retcode to set.
* @return This builder for chaining.
*/
public Builder setRetcode(int value) {
retcode_ = value;
onChanged();
return this;
}
/**
* <code>int32 retcode = 4;</code>
* @return This builder for chaining.
*/
public Builder clearRetcode() {
retcode_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:DungeonSlipRevivePointActivateRsp)
}
// @@protoc_insertion_point(class_scope:DungeonSlipRevivePointActivateRsp)
private static final emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp();
}
public static emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DungeonSlipRevivePointActivateRsp>
PARSER = new com.google.protobuf.AbstractParser<DungeonSlipRevivePointActivateRsp>() {
@java.lang.Override
public DungeonSlipRevivePointActivateRsp parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DungeonSlipRevivePointActivateRsp(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DungeonSlipRevivePointActivateRsp> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DungeonSlipRevivePointActivateRsp> getParserForType() {
return PARSER;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_DungeonSlipRevivePointActivateRsp_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_DungeonSlipRevivePointActivateRsp_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\'DungeonSlipRevivePointActivateRsp.prot" +
"o\"R\n!DungeonSlipRevivePointActivateRsp\022\034" +
"\n\024slip_revive_point_id\030\016 \001(\r\022\017\n\007retcode\030" +
"\004 \001(\005B\033\n\031emu.grasscutter.net.protob\006prot" +
"o3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_DungeonSlipRevivePointActivateRsp_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_DungeonSlipRevivePointActivateRsp_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_DungeonSlipRevivePointActivateRsp_descriptor,
new java.lang.String[] { "SlipRevivePointId", "Retcode", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -0,0 +1,551 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DungeonWayPointActivateReq.proto
package emu.grasscutter.net.proto;
public final class DungeonWayPointActivateReqOuterClass {
private DungeonWayPointActivateReqOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface DungeonWayPointActivateReqOrBuilder extends
// @@protoc_insertion_point(interface_extends:DungeonWayPointActivateReq)
com.google.protobuf.MessageOrBuilder {
/**
* <code>uint32 way_point_id = 3;</code>
* @return The wayPointId.
*/
int getWayPointId();
}
/**
* <pre>
* CmdId: 990
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonWayPointActivateReq}
*/
public static final class DungeonWayPointActivateReq extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:DungeonWayPointActivateReq)
DungeonWayPointActivateReqOrBuilder {
private static final long serialVersionUID = 0L;
// Use DungeonWayPointActivateReq.newBuilder() to construct.
private DungeonWayPointActivateReq(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DungeonWayPointActivateReq() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DungeonWayPointActivateReq();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DungeonWayPointActivateReq(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 24: {
wayPointId_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.internal_static_DungeonWayPointActivateReq_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.internal_static_DungeonWayPointActivateReq_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq.class, emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq.Builder.class);
}
public static final int WAY_POINT_ID_FIELD_NUMBER = 3;
private int wayPointId_;
/**
* <code>uint32 way_point_id = 3;</code>
* @return The wayPointId.
*/
@java.lang.Override
public int getWayPointId() {
return wayPointId_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (wayPointId_ != 0) {
output.writeUInt32(3, wayPointId_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (wayPointId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(3, wayPointId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq)) {
return super.equals(obj);
}
emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq other = (emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq) obj;
if (getWayPointId()
!= other.getWayPointId()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + WAY_POINT_ID_FIELD_NUMBER;
hash = (53 * hash) + getWayPointId();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* CmdId: 990
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonWayPointActivateReq}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:DungeonWayPointActivateReq)
emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReqOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.internal_static_DungeonWayPointActivateReq_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.internal_static_DungeonWayPointActivateReq_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq.class, emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq.Builder.class);
}
// Construct using emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
wayPointId_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.internal_static_DungeonWayPointActivateReq_descriptor;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq getDefaultInstanceForType() {
return emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq.getDefaultInstance();
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq build() {
emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq buildPartial() {
emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq result = new emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq(this);
result.wayPointId_ = wayPointId_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq) {
return mergeFrom((emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq other) {
if (other == emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq.getDefaultInstance()) return this;
if (other.getWayPointId() != 0) {
setWayPointId(other.getWayPointId());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int wayPointId_ ;
/**
* <code>uint32 way_point_id = 3;</code>
* @return The wayPointId.
*/
@java.lang.Override
public int getWayPointId() {
return wayPointId_;
}
/**
* <code>uint32 way_point_id = 3;</code>
* @param value The wayPointId to set.
* @return This builder for chaining.
*/
public Builder setWayPointId(int value) {
wayPointId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 way_point_id = 3;</code>
* @return This builder for chaining.
*/
public Builder clearWayPointId() {
wayPointId_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:DungeonWayPointActivateReq)
}
// @@protoc_insertion_point(class_scope:DungeonWayPointActivateReq)
private static final emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq();
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DungeonWayPointActivateReq>
PARSER = new com.google.protobuf.AbstractParser<DungeonWayPointActivateReq>() {
@java.lang.Override
public DungeonWayPointActivateReq parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DungeonWayPointActivateReq(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DungeonWayPointActivateReq> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DungeonWayPointActivateReq> getParserForType() {
return PARSER;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_DungeonWayPointActivateReq_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_DungeonWayPointActivateReq_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n DungeonWayPointActivateReq.proto\"2\n\032Du" +
"ngeonWayPointActivateReq\022\024\n\014way_point_id" +
"\030\003 \001(\rB\033\n\031emu.grasscutter.net.protob\006pro" +
"to3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_DungeonWayPointActivateReq_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_DungeonWayPointActivateReq_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_DungeonWayPointActivateReq_descriptor,
new java.lang.String[] { "WayPointId", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -0,0 +1,621 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DungeonWayPointActivateRsp.proto
package emu.grasscutter.net.proto;
public final class DungeonWayPointActivateRspOuterClass {
private DungeonWayPointActivateRspOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface DungeonWayPointActivateRspOrBuilder extends
// @@protoc_insertion_point(interface_extends:DungeonWayPointActivateRsp)
com.google.protobuf.MessageOrBuilder {
/**
* <code>int32 retcode = 6;</code>
* @return The retcode.
*/
int getRetcode();
/**
* <code>uint32 way_point_id = 7;</code>
* @return The wayPointId.
*/
int getWayPointId();
}
/**
* <pre>
* CmdId: 973
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonWayPointActivateRsp}
*/
public static final class DungeonWayPointActivateRsp extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:DungeonWayPointActivateRsp)
DungeonWayPointActivateRspOrBuilder {
private static final long serialVersionUID = 0L;
// Use DungeonWayPointActivateRsp.newBuilder() to construct.
private DungeonWayPointActivateRsp(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DungeonWayPointActivateRsp() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DungeonWayPointActivateRsp();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DungeonWayPointActivateRsp(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 48: {
retcode_ = input.readInt32();
break;
}
case 56: {
wayPointId_ = input.readUInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.internal_static_DungeonWayPointActivateRsp_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.internal_static_DungeonWayPointActivateRsp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp.class, emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp.Builder.class);
}
public static final int RETCODE_FIELD_NUMBER = 6;
private int retcode_;
/**
* <code>int32 retcode = 6;</code>
* @return The retcode.
*/
@java.lang.Override
public int getRetcode() {
return retcode_;
}
public static final int WAY_POINT_ID_FIELD_NUMBER = 7;
private int wayPointId_;
/**
* <code>uint32 way_point_id = 7;</code>
* @return The wayPointId.
*/
@java.lang.Override
public int getWayPointId() {
return wayPointId_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (retcode_ != 0) {
output.writeInt32(6, retcode_);
}
if (wayPointId_ != 0) {
output.writeUInt32(7, wayPointId_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (retcode_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(6, retcode_);
}
if (wayPointId_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(7, wayPointId_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp)) {
return super.equals(obj);
}
emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp other = (emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp) obj;
if (getRetcode()
!= other.getRetcode()) return false;
if (getWayPointId()
!= other.getWayPointId()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + RETCODE_FIELD_NUMBER;
hash = (53 * hash) + getRetcode();
hash = (37 * hash) + WAY_POINT_ID_FIELD_NUMBER;
hash = (53 * hash) + getWayPointId();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* CmdId: 973
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonWayPointActivateRsp}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:DungeonWayPointActivateRsp)
emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRspOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.internal_static_DungeonWayPointActivateRsp_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.internal_static_DungeonWayPointActivateRsp_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp.class, emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp.Builder.class);
}
// Construct using emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
retcode_ = 0;
wayPointId_ = 0;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.internal_static_DungeonWayPointActivateRsp_descriptor;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp getDefaultInstanceForType() {
return emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp.getDefaultInstance();
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp build() {
emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp buildPartial() {
emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp result = new emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp(this);
result.retcode_ = retcode_;
result.wayPointId_ = wayPointId_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp) {
return mergeFrom((emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp other) {
if (other == emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp.getDefaultInstance()) return this;
if (other.getRetcode() != 0) {
setRetcode(other.getRetcode());
}
if (other.getWayPointId() != 0) {
setWayPointId(other.getWayPointId());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int retcode_ ;
/**
* <code>int32 retcode = 6;</code>
* @return The retcode.
*/
@java.lang.Override
public int getRetcode() {
return retcode_;
}
/**
* <code>int32 retcode = 6;</code>
* @param value The retcode to set.
* @return This builder for chaining.
*/
public Builder setRetcode(int value) {
retcode_ = value;
onChanged();
return this;
}
/**
* <code>int32 retcode = 6;</code>
* @return This builder for chaining.
*/
public Builder clearRetcode() {
retcode_ = 0;
onChanged();
return this;
}
private int wayPointId_ ;
/**
* <code>uint32 way_point_id = 7;</code>
* @return The wayPointId.
*/
@java.lang.Override
public int getWayPointId() {
return wayPointId_;
}
/**
* <code>uint32 way_point_id = 7;</code>
* @param value The wayPointId to set.
* @return This builder for chaining.
*/
public Builder setWayPointId(int value) {
wayPointId_ = value;
onChanged();
return this;
}
/**
* <code>uint32 way_point_id = 7;</code>
* @return This builder for chaining.
*/
public Builder clearWayPointId() {
wayPointId_ = 0;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:DungeonWayPointActivateRsp)
}
// @@protoc_insertion_point(class_scope:DungeonWayPointActivateRsp)
private static final emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp();
}
public static emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DungeonWayPointActivateRsp>
PARSER = new com.google.protobuf.AbstractParser<DungeonWayPointActivateRsp>() {
@java.lang.Override
public DungeonWayPointActivateRsp parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DungeonWayPointActivateRsp(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DungeonWayPointActivateRsp> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DungeonWayPointActivateRsp> getParserForType() {
return PARSER;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_DungeonWayPointActivateRsp_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_DungeonWayPointActivateRsp_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n DungeonWayPointActivateRsp.proto\"C\n\032Du" +
"ngeonWayPointActivateRsp\022\017\n\007retcode\030\006 \001(" +
"\005\022\024\n\014way_point_id\030\007 \001(\rB\033\n\031emu.grasscutt" +
"er.net.protob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_DungeonWayPointActivateRsp_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_DungeonWayPointActivateRsp_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_DungeonWayPointActivateRsp_descriptor,
new java.lang.String[] { "Retcode", "WayPointId", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -0,0 +1,749 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: DungeonWayPointNotify.proto
package emu.grasscutter.net.proto;
public final class DungeonWayPointNotifyOuterClass {
private DungeonWayPointNotifyOuterClass() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLite registry) {
}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
registerAllExtensions(
(com.google.protobuf.ExtensionRegistryLite) registry);
}
public interface DungeonWayPointNotifyOrBuilder extends
// @@protoc_insertion_point(interface_extends:DungeonWayPointNotify)
com.google.protobuf.MessageOrBuilder {
/**
* <code>bool is_add = 9;</code>
* @return The isAdd.
*/
boolean getIsAdd();
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @return A list containing the activeWayPointList.
*/
java.util.List<java.lang.Integer> getActiveWayPointListList();
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @return The count of activeWayPointList.
*/
int getActiveWayPointListCount();
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @param index The index of the element to return.
* @return The activeWayPointList at the given index.
*/
int getActiveWayPointList(int index);
}
/**
* <pre>
* CmdId: 903
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonWayPointNotify}
*/
public static final class DungeonWayPointNotify extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:DungeonWayPointNotify)
DungeonWayPointNotifyOrBuilder {
private static final long serialVersionUID = 0L;
// Use DungeonWayPointNotify.newBuilder() to construct.
private DungeonWayPointNotify(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private DungeonWayPointNotify() {
activeWayPointList_ = emptyIntList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new DungeonWayPointNotify();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private DungeonWayPointNotify(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 32: {
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
activeWayPointList_ = newIntList();
mutable_bitField0_ |= 0x00000001;
}
activeWayPointList_.addInt(input.readUInt32());
break;
}
case 34: {
int length = input.readRawVarint32();
int limit = input.pushLimit(length);
if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) {
activeWayPointList_ = newIntList();
mutable_bitField0_ |= 0x00000001;
}
while (input.getBytesUntilLimit() > 0) {
activeWayPointList_.addInt(input.readUInt32());
}
input.popLimit(limit);
break;
}
case 72: {
isAdd_ = input.readBool();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
activeWayPointList_.makeImmutable(); // C
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.internal_static_DungeonWayPointNotify_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.internal_static_DungeonWayPointNotify_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify.class, emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify.Builder.class);
}
public static final int IS_ADD_FIELD_NUMBER = 9;
private boolean isAdd_;
/**
* <code>bool is_add = 9;</code>
* @return The isAdd.
*/
@java.lang.Override
public boolean getIsAdd() {
return isAdd_;
}
public static final int ACTIVE_WAY_POINT_LIST_FIELD_NUMBER = 4;
private com.google.protobuf.Internal.IntList activeWayPointList_;
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @return A list containing the activeWayPointList.
*/
@java.lang.Override
public java.util.List<java.lang.Integer>
getActiveWayPointListList() {
return activeWayPointList_;
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @return The count of activeWayPointList.
*/
public int getActiveWayPointListCount() {
return activeWayPointList_.size();
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @param index The index of the element to return.
* @return The activeWayPointList at the given index.
*/
public int getActiveWayPointList(int index) {
return activeWayPointList_.getInt(index);
}
private int activeWayPointListMemoizedSerializedSize = -1;
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (getActiveWayPointListList().size() > 0) {
output.writeUInt32NoTag(34);
output.writeUInt32NoTag(activeWayPointListMemoizedSerializedSize);
}
for (int i = 0; i < activeWayPointList_.size(); i++) {
output.writeUInt32NoTag(activeWayPointList_.getInt(i));
}
if (isAdd_ != false) {
output.writeBool(9, isAdd_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
{
int dataSize = 0;
for (int i = 0; i < activeWayPointList_.size(); i++) {
dataSize += com.google.protobuf.CodedOutputStream
.computeUInt32SizeNoTag(activeWayPointList_.getInt(i));
}
size += dataSize;
if (!getActiveWayPointListList().isEmpty()) {
size += 1;
size += com.google.protobuf.CodedOutputStream
.computeInt32SizeNoTag(dataSize);
}
activeWayPointListMemoizedSerializedSize = dataSize;
}
if (isAdd_ != false) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(9, isAdd_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify)) {
return super.equals(obj);
}
emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify other = (emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify) obj;
if (getIsAdd()
!= other.getIsAdd()) return false;
if (!getActiveWayPointListList()
.equals(other.getActiveWayPointListList())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + IS_ADD_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getIsAdd());
if (getActiveWayPointListCount() > 0) {
hash = (37 * hash) + ACTIVE_WAY_POINT_LIST_FIELD_NUMBER;
hash = (53 * hash) + getActiveWayPointListList().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* CmdId: 903
* EnetChannelId: 0
* EnetIsReliable: false
* IsAllowClient: true
* </pre>
*
* Protobuf type {@code DungeonWayPointNotify}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:DungeonWayPointNotify)
emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotifyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.internal_static_DungeonWayPointNotify_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.internal_static_DungeonWayPointNotify_fieldAccessorTable
.ensureFieldAccessorsInitialized(
emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify.class, emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify.Builder.class);
}
// Construct using emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
isAdd_ = false;
activeWayPointList_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000001);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.internal_static_DungeonWayPointNotify_descriptor;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify getDefaultInstanceForType() {
return emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify.getDefaultInstance();
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify build() {
emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify buildPartial() {
emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify result = new emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify(this);
int from_bitField0_ = bitField0_;
result.isAdd_ = isAdd_;
if (((bitField0_ & 0x00000001) != 0)) {
activeWayPointList_.makeImmutable();
bitField0_ = (bitField0_ & ~0x00000001);
}
result.activeWayPointList_ = activeWayPointList_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify) {
return mergeFrom((emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify other) {
if (other == emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify.getDefaultInstance()) return this;
if (other.getIsAdd() != false) {
setIsAdd(other.getIsAdd());
}
if (!other.activeWayPointList_.isEmpty()) {
if (activeWayPointList_.isEmpty()) {
activeWayPointList_ = other.activeWayPointList_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureActiveWayPointListIsMutable();
activeWayPointList_.addAll(other.activeWayPointList_);
}
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private boolean isAdd_ ;
/**
* <code>bool is_add = 9;</code>
* @return The isAdd.
*/
@java.lang.Override
public boolean getIsAdd() {
return isAdd_;
}
/**
* <code>bool is_add = 9;</code>
* @param value The isAdd to set.
* @return This builder for chaining.
*/
public Builder setIsAdd(boolean value) {
isAdd_ = value;
onChanged();
return this;
}
/**
* <code>bool is_add = 9;</code>
* @return This builder for chaining.
*/
public Builder clearIsAdd() {
isAdd_ = false;
onChanged();
return this;
}
private com.google.protobuf.Internal.IntList activeWayPointList_ = emptyIntList();
private void ensureActiveWayPointListIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
activeWayPointList_ = mutableCopy(activeWayPointList_);
bitField0_ |= 0x00000001;
}
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @return A list containing the activeWayPointList.
*/
public java.util.List<java.lang.Integer>
getActiveWayPointListList() {
return ((bitField0_ & 0x00000001) != 0) ?
java.util.Collections.unmodifiableList(activeWayPointList_) : activeWayPointList_;
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @return The count of activeWayPointList.
*/
public int getActiveWayPointListCount() {
return activeWayPointList_.size();
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @param index The index of the element to return.
* @return The activeWayPointList at the given index.
*/
public int getActiveWayPointList(int index) {
return activeWayPointList_.getInt(index);
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @param index The index to set the value at.
* @param value The activeWayPointList to set.
* @return This builder for chaining.
*/
public Builder setActiveWayPointList(
int index, int value) {
ensureActiveWayPointListIsMutable();
activeWayPointList_.setInt(index, value);
onChanged();
return this;
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @param value The activeWayPointList to add.
* @return This builder for chaining.
*/
public Builder addActiveWayPointList(int value) {
ensureActiveWayPointListIsMutable();
activeWayPointList_.addInt(value);
onChanged();
return this;
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @param values The activeWayPointList to add.
* @return This builder for chaining.
*/
public Builder addAllActiveWayPointList(
java.lang.Iterable<? extends java.lang.Integer> values) {
ensureActiveWayPointListIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, activeWayPointList_);
onChanged();
return this;
}
/**
* <code>repeated uint32 active_way_point_list = 4;</code>
* @return This builder for chaining.
*/
public Builder clearActiveWayPointList() {
activeWayPointList_ = emptyIntList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:DungeonWayPointNotify)
}
// @@protoc_insertion_point(class_scope:DungeonWayPointNotify)
private static final emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify();
}
public static emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<DungeonWayPointNotify>
PARSER = new com.google.protobuf.AbstractParser<DungeonWayPointNotify>() {
@java.lang.Override
public DungeonWayPointNotify parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new DungeonWayPointNotify(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<DungeonWayPointNotify> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<DungeonWayPointNotify> getParserForType() {
return PARSER;
}
@java.lang.Override
public emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass.DungeonWayPointNotify getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private static final com.google.protobuf.Descriptors.Descriptor
internal_static_DungeonWayPointNotify_descriptor;
private static final
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internal_static_DungeonWayPointNotify_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\033DungeonWayPointNotify.proto\"F\n\025Dungeon" +
"WayPointNotify\022\016\n\006is_add\030\t \001(\010\022\035\n\025active" +
"_way_point_list\030\004 \003(\rB\033\n\031emu.grasscutter" +
".net.protob\006proto3"
};
descriptor = com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
});
internal_static_DungeonWayPointNotify_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_DungeonWayPointNotify_fieldAccessorTable = new
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
internal_static_DungeonWayPointNotify_descriptor,
new java.lang.String[] { "IsAdd", "ActiveWayPointList", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -8,6 +8,7 @@ import java.util.Map;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.binout.*;
import emu.grasscutter.game.dungeons.DungeonDropEntry;
import emu.grasscutter.game.quest.QuestEncryptionKey;
import emu.grasscutter.utils.Utils;
import emu.grasscutter.data.excels.*;
@ -85,7 +86,8 @@ public class GameData {
private static final Int2ObjectMap<DailyDungeonData> dailyDungeonDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<DungeonEntryData> dungeonEntryDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<DungeonData> dungeonDataMap = new Int2ObjectOpenHashMap<>();
@Getter private static final Int2ObjectMap<DungeonData> dungeonDataMap = new Int2ObjectOpenHashMap<>();
@Getter private static final Int2ObjectMap<DungeonPassConfigData> dungeonPassConfigDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<QuestData> questDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<ShopGoodsData> shopGoodsDataMap = new Int2ObjectOpenHashMap<>();
private static final Int2ObjectMap<CombineData> combineDataMap = new Int2ObjectOpenHashMap<>();
@ -119,6 +121,8 @@ public class GameData {
@Getter private static final Int2ObjectMap<OpenStateData> openStateDataMap = new Int2ObjectOpenHashMap<>();
@Getter private static final Int2ObjectMap<List<DungeonDropEntry>> dungeonDropDataMap = new Int2ObjectOpenHashMap<>();
// Cache
private static Map<Integer, List<Integer>> fetters = new HashMap<>();
private static Map<Integer, List<ShopGoodsData>> shopGoods = new HashMap<>();
@ -374,10 +378,6 @@ public class GameData {
return worldLevelDataMap;
}
public static Int2ObjectMap<DungeonData> getDungeonDataMap() {
return dungeonDataMap;
}
public static Int2ObjectMap<DailyDungeonData> getDailyDungeonDataMap() {
return dailyDungeonDataMap;
}

View File

@ -9,6 +9,7 @@ import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierAction;
import emu.grasscutter.data.binout.AbilityModifier.AbilityModifierActionType;
import emu.grasscutter.data.common.PointData;
import emu.grasscutter.data.common.ScenePointConfig;
import emu.grasscutter.game.dungeons.DungeonDrop;
import emu.grasscutter.game.managers.blossom.BlossomConfig;
import emu.grasscutter.game.quest.QuestEncryptionKey;
import emu.grasscutter.game.world.SpawnDataEntry;
@ -72,6 +73,7 @@ public class ResourceLoader {
loadSpawnData();
loadQuests();
loadScriptSceneData();
loadDungeonDrops();
// Load scene points - must be done AFTER resources are loaded
loadScenePoints();
// Load default home layout
@ -341,6 +343,18 @@ public class ResourceLoader {
GameDepot.addSpawnListById(areaSort);
}
private static void loadDungeonDrops(){
try {
DataLoader.loadList("DungeonDrop.json", DungeonDrop.class).forEach(entry -> {
GameData.getDungeonDropDataMap().put(entry.getDungeonId(), entry.getDrops());
});
Grasscutter.getLogger().debug("Loaded {} dungeon drop data entries.", GameData.getDungeonDropDataMap().size());
}
catch (Exception ex) {
Grasscutter.getLogger().error("Unable to load dungeon drop data.", ex);
}
}
private static void loadOpenConfig() {
// Read from cached file if exists
List<OpenConfigEntry> list = null;

View File

@ -3,51 +3,71 @@ package emu.grasscutter.data.excels;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;
import emu.grasscutter.game.dungeons.*;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import lombok.Getter;
import emu.grasscutter.game.props.SceneType;
import java.util.List;
@ResourceType(name = "DungeonExcelConfigData.json")
public class DungeonData extends GameResource {
private int id;
private int sceneId;
private int showLevel;
private int passRewardPreviewID;
private String involveType; // TODO enum
private RewardPreviewData previewData;
@Getter private int sceneId;
@Getter private int showLevel;
private DungeonType type;
private DungeonSubType subType;
private DungeonPlayType playType;
private DungeonInvolveType involveType;
@Getter private int limitLevel;
@Getter private int passCond;
@Getter private int reviveMaxCount;
@Getter private int settleCountdownTime;
@Getter private int failSettleCountdownTime;
@Getter private int quitSettleCountdownTime;
@Getter private List<SettleShowType> settleShows;
@Getter private int passRewardPreviewID;
@Getter private int statueCostID;
@Getter private int statueCostCount;
@Getter private RewardPreviewData rewardPreviewData;
private int statueCostID;
private int statueCostCount;
@Override
public int getId() {
return this.id;
}
public int getSceneId() {
return sceneId;
}
public int getShowLevel() {
return showLevel;
}
public DungeonType getType() {
if (type == null) {
return DungeonType.DUNGEON_NONE;
}
return type;
}
public RewardPreviewData getRewardPreview() {
return previewData;
}
public DungeonSubType getSubType() {
if (subType == null) {
return DungeonSubType.DUNGEON_SUB_NONE;
}
return subType;
}
public int getStatueCostID() {
return statueCostID;
}
public DungeonPlayType getPlayType() {
if (playType == null) {
return DungeonPlayType.DUNGEON_PLAY_TYPE_NONE;
}
return playType;
}
public int getStatueCostCount() {
return statueCostCount;
}
public DungeonInvolveType getInvolveType() {
if (involveType == null) {
return DungeonInvolveType.INVOLVE_NONE;
}
return involveType;
}
@Override
public void onLoad() {
if (this.passRewardPreviewID > 0) {
this.previewData = GameData.getRewardPreviewDataMap().get(this.passRewardPreviewID);
this.rewardPreviewData = GameData.getRewardPreviewDataMap().get(this.passRewardPreviewID);
}
}
}

View File

@ -0,0 +1,22 @@
package emu.grasscutter.data.excels;
import emu.grasscutter.data.GameResource;
import emu.grasscutter.data.ResourceType;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.quest.enums.LogicType;
import lombok.Getter;
import java.util.List;
@ResourceType(name = "DungeonPassExcelConfigData.json")
public class DungeonPassConfigData extends GameResource {
@Getter private int id;
@Getter private LogicType logicType;
@Getter private List<DungeonPassCondition> conds;
public static class DungeonPassCondition{
@Getter private DungeonPassConditionType condType;
@Getter int[] param;
}
}

View File

@ -1,6 +1,5 @@
package emu.grasscutter.data.excels;
import java.util.Arrays;
import java.util.List;
import com.google.gson.annotations.SerializedName;

View File

@ -130,6 +130,9 @@ public class ActivityManager extends BasePlayerManager {
public boolean meetsCondition(int conditionId) {
var activityId = conditionId / 1000; // todo some only have 2 numbers for the condition
var activityConfig = activityConfigItemMap.get(activityId);
if(activityConfig==null){
return false;
}
// TODO add condition handling based on ExcelBinOutput/NewActivityCondExcelConfigData.json
return activityConfig.getMeetCondList().contains(conditionId);

View File

@ -1,14 +1,17 @@
package emu.grasscutter.game.dungeons;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult;
import emu.grasscutter.server.packet.send.PacketDungeonSettleNotify;
import emu.grasscutter.utils.Utils;
public class BasicDungeonSettleListener implements DungeonSettleListener {
@Override
public void onDungeonSettle(Scene scene) {
scene.setAutoCloseTime(Utils.getCurrentSeconds() + 1000);
scene.broadcastPacket(new PacketDungeonSettleNotify(scene.getChallenge()));
public void onDungeonSettle(DungeonManager dungeonManager, BaseDungeonResult.DungeonEndReason endReason) {
var scene = dungeonManager.getScene();
var dungeonData = dungeonManager.getDungeonData();
// TODO time taken and chests handling
DungeonEndStats stats = new DungeonEndStats(scene.getKilledMonsterCount(), 0, 0, endReason);
scene.broadcastPacket(new PacketDungeonSettleNotify(new BaseDungeonResult(dungeonData, stats)));
}
}

View File

@ -0,0 +1,18 @@
package emu.grasscutter.game.dungeons;
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult;
import lombok.Getter;
public class DungeonEndStats {
@Getter private int killedMonsters;
@Getter private int timeTaken;
@Getter private int openChestCount;
@Getter private BaseDungeonResult.DungeonEndReason dungeonResult;
public DungeonEndStats(int killedMonsters, int timeTaken, int openChestCount, BaseDungeonResult.DungeonEndReason dungeonResult){
this.killedMonsters = killedMonsters;
this.timeTaken = timeTaken;
this.dungeonResult = dungeonResult;
this.openChestCount = openChestCount;
}
}

View File

@ -0,0 +1,7 @@
package emu.grasscutter.game.dungeons;
public enum DungeonInvolveType {
INVOLVE_NONE,
INVOLVE_ONLY_SINGLE,
INVOLVE_SINGLE_MULTIPLE
}

View File

@ -0,0 +1,251 @@
package emu.grasscutter.game.dungeons;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.common.ItemParamData;
import emu.grasscutter.data.excels.DungeonData;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.ActionReason;
import emu.grasscutter.game.props.WatcherTriggerType;
import emu.grasscutter.game.quest.enums.LogicType;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.scripts.constants.EventType;
import emu.grasscutter.scripts.data.ScriptArgs;
import emu.grasscutter.server.packet.send.PacketDungeonWayPointNotify;
import emu.grasscutter.server.packet.send.PacketGadgetAutoPickDropInfoNotify;
import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import it.unimi.dsi.fastutil.ints.IntSet;
import lombok.Getter;
import lombok.NonNull;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* TODO handle time limits
* TODO handle respawn points
* TODO handle team wipes and respawns
* TODO check monster level and levelConfigMap
*/
public class DungeonManager {
@Getter private final Scene scene;
@Getter private final DungeonData dungeonData;
@Getter private final DungeonPassConfigData passConfigData;
@Getter private final int[] finishedConditions;
private final IntSet rewardedPlayers = new IntOpenHashSet();
private boolean isended = false;
private Set<Integer> activeDungeonWayPoints = new HashSet<>();
public DungeonManager(@NonNull Scene scene, @NonNull DungeonData dungeonData) {
this.scene = scene;
this.dungeonData = dungeonData;
this.passConfigData = GameData.getDungeonPassConfigDataMap().get(dungeonData.getPassCond());
this.finishedConditions = new int[passConfigData.getConds().size()];
this.scene.setDungeonManager(this);
}
public void triggerEvent(DungeonPassConditionType conditionType, int... params) {
if(isended){
return;
}
for (int i = 0; i < passConfigData.getConds().size(); i++) {
var cond = passConfigData.getConds().get(i);
if (conditionType == cond.getCondType()) {
if (getScene().getWorld().getServer().getDungeonSystem().triggerCondition(cond, params)) {
finishedConditions[i] = 1;
}
}
}
if (isFinishedSuccessfully()) {
finishDungeon();
}
}
public boolean isFinishedSuccessfully(){
return LogicType.calculate(passConfigData.getLogicType(), finishedConditions);
}
public int getLevelForMonster(int id){
//TODO should use levelConfigMap? and how?
return dungeonData.getShowLevel();
}
public boolean activateRespawnPoint(int pointId){
//TODO implement
scene.broadcastPacket(new PacketDungeonWayPointNotify(activeDungeonWayPoints.add(pointId), activeDungeonWayPoints));
Grasscutter.getLogger().warn("[unimplemented] trying to activate respawn point {}", pointId);
return true;
}
public boolean getStatueDrops(Player player, boolean useCondensed) {
if (!isFinishedSuccessfully() || dungeonData.getRewardPreviewData() == null || dungeonData.getRewardPreviewData().getPreviewItems().length == 0) {
return false;
}
// Already rewarded
if (rewardedPlayers.contains(player.getUid())) {
return false;
}
if(!handleCost(player, useCondensed)){
return false;
}
// Get and roll rewards.
List<GameItem> rewards = new ArrayList<>(this.rollRewards(useCondensed));
// Add rewards to player and send notification.
player.getInventory().addItems(rewards, ActionReason.DungeonStatueDrop);
player.sendPacket(new PacketGadgetAutoPickDropInfoNotify(rewards));
rewardedPlayers.add(player.getUid());
scene.getScriptManager().callEvent(EventType.EVENT_DUNGEON_REWARD_GET,
new ScriptArgs());
return true;
}
public boolean handleCost(Player player, boolean useCondensed){
int resinCost = dungeonData.getStatueCostCount() != 0 ? dungeonData.getStatueCostCount() : 20;
if(resinCost == 0){
return true;
}
if (useCondensed) {
// Check if condensed resin is usable here.
// For this, we use the following logic for now:
// The normal resin cost of the dungeon has to be 20.
if (resinCost != 20) {
return false;
}
// Spend the condensed resin and only proceed if the transaction succeeds.
return player.getResinManager().useCondensedResin(1);
}
else if(dungeonData.getStatueCostID() == 106){
// Spend the resin and only proceed if the transaction succeeds.
return player.getResinManager().useResin(resinCost);
}
return true;
}
private List<GameItem> rollRewards(boolean useCondensed) {
List<GameItem> rewards = new ArrayList<>();
int dungeonId = this.dungeonData.getId();
// If we have specific drop data for this dungeon, we use it.
if (GameData.getDungeonDropDataMap().containsKey(dungeonId)) {
List<DungeonDropEntry> dropEntries = GameData.getDungeonDropDataMap().get(dungeonId);
// Roll for each drop group.
for (var entry : dropEntries) {
// Determine the number of drops we get for this entry.
int start = entry.getCounts().get(0);
int end = entry.getCounts().get(entry.getCounts().size() - 1);
var candidateAmounts = IntStream.range(start, end + 1).boxed().collect(Collectors.toList());
int amount = Utils.drawRandomListElement(candidateAmounts, entry.getProbabilities());
if (useCondensed) {
amount += Utils.drawRandomListElement(candidateAmounts, entry.getProbabilities());
}
// Double rewards in multiplay mode, if specified.
if (entry.isMpDouble() && this.getScene().getPlayerCount() > 1) {
amount *= 2;
}
// Roll items for this group.
// Here, we have to handle stacking, or the client will not display results correctly.
// For now, we use the following logic: If the possible drop item are a list of multiple items,
// we roll them separately. If not, we stack them. This should work out in practice, at least
// for the currently existing set of dungeons.
if (entry.getItems().size() == 1) {
rewards.add(new GameItem(entry.getItems().get(0), amount));
}
else {
for (int i = 0; i < amount; i++) {
// int itemIndex = ThreadLocalRandom.current().nextInt(0, entry.getItems().size());
// int itemId = entry.getItems().get(itemIndex);
int itemId = Utils.drawRandomListElement(entry.getItems(), entry.getItemProbabilities());
rewards.add(new GameItem(itemId, 1));
}
}
}
}
// Otherwise, we fall back to the preview data.
else {
Grasscutter.getLogger().info("No drop data found or dungeon {}, falling back to preview data ...", dungeonId);
for (ItemParamData param : dungeonData.getRewardPreviewData().getPreviewItems()) {
rewards.add(new GameItem(param.getId(), Math.max(param.getCount(), 1)));
}
}
return rewards;
}
public void startDungeon() {
scene.getPlayers().forEach(p-> p.getQuestManager().triggerEvent(QuestTrigger.QUEST_CONTENT_ENTER_DUNGEON, dungeonData.getId()));
}
public void finishDungeon() {
notifyEndDungeon(true);
endDungeon(BaseDungeonResult.DungeonEndReason.COMPLETED);
}
public void notifyEndDungeon(boolean successfully){
scene.getPlayers().forEach(p -> {
// Quest trigger
p.getQuestManager().triggerEvent(successfully?
QuestTrigger.QUEST_CONTENT_FINISH_DUNGEON : QuestTrigger.QUEST_CONTENT_FAIL_DUNGEON,
dungeonData.getId());
// Battle pass trigger
if(dungeonData.getType().isCountsToBattlepass() && successfully) {
p.getBattlePassManager().triggerMission(WatcherTriggerType.TRIGGER_FINISH_DUNGEON);
}
});
scene.getScriptManager().callEvent(EventType.EVENT_DUNGEON_SETTLE,
new ScriptArgs(successfully ? 1 : 0));
}
public void quitDungeon() {
notifyEndDungeon(false);
endDungeon(BaseDungeonResult.DungeonEndReason.QUIT);
}
public void failDungeon() {
notifyEndDungeon(false);
endDungeon(BaseDungeonResult.DungeonEndReason.FAILED);
}
public void endDungeon(BaseDungeonResult.DungeonEndReason endReason) {
if(scene.getDungeonSettleListeners()!=null) {
scene.getDungeonSettleListeners().forEach(o -> o.onDungeonSettle(this, endReason));
}
isended = true;
}
public void restartDungeon() {
this.scene.setKilledMonsterCount(0);
this.rewardedPlayers.clear();
Arrays.fill(finishedConditions, 0);
this.isended = false;
this.activeDungeonWayPoints.clear();
}
public void cleanUpScene(){
this.scene.setDungeonManager(null);
this.scene.setKilledMonsterCount(0);
}
}

View File

@ -0,0 +1,13 @@
package emu.grasscutter.game.dungeons;
public enum DungeonPassConditionType {
DUNGEON_COND_NONE,
DUNGEON_COND_KILL_GROUP_MONSTER,
DUNGEON_COND_KILL_TYPE_MONSTER,
DUNGEON_COND_FINISH_QUEST,
DUNGEON_COND_IN_TIME, // Missing triggers and tracking
DUNGEON_COND_KILL_MONSTER_COUNT, // TODO handle count
DUNGEON_COND_KILL_MONSTER,
DUNGEON_COND_FINISH_CHALLENGE,
DUNGEON_COND_END_MULTISTAGE_PLAY // Missing
}

View File

@ -0,0 +1,6 @@
package emu.grasscutter.game.dungeons;
public enum DungeonPlayType {
DUNGEON_PLAY_TYPE_NONE,
DUNGEON_PLAY_TYPE_MIST_TRIAL,
DUNGEON_PLAY_TYPE_TRIAL_AVATAR
}

View File

@ -1,7 +1,7 @@
package emu.grasscutter.game.dungeons;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult;
public interface DungeonSettleListener {
void onDungeonSettle(Scene scene);
void onDungeonSettle(DungeonManager dungeonManager, BaseDungeonResult.DungeonEndReason endReason);
}

View File

@ -0,0 +1,9 @@
package emu.grasscutter.game.dungeons;
public enum DungeonSubType {
DUNGEON_SUB_NONE,
DUNGEON_SUB_BOSS,
DUNGEON_SUB_TALENT,
DUNGEON_SUB_WEAPON,
DUNGEON_SUB_RELIQUARY
}

View File

@ -5,9 +5,16 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.binout.ScenePointEntry;
import emu.grasscutter.data.excels.DungeonData;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.SceneType;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
import emu.grasscutter.game.quest.handlers.QuestExecHandler;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
@ -16,14 +23,47 @@ import emu.grasscutter.server.game.GameServer;
import emu.grasscutter.server.packet.send.PacketDungeonEntryInfoRsp;
import emu.grasscutter.server.packet.send.PacketPlayerEnterDungeonRsp;
import emu.grasscutter.utils.Position;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import org.reflections.Reflections;
import java.util.List;
public class DungeonSystem extends BaseGameSystem {
private static final BasicDungeonSettleListener basicDungeonSettleObserver = new BasicDungeonSettleListener();
private final Int2ObjectMap<DungeonBaseHandler> passCondHandlers;
public DungeonSystem(GameServer server) {
super(server);
this.passCondHandlers = new Int2ObjectOpenHashMap<>();
registerHandlers();
}
public void registerHandlers() {
this.registerHandlers(this.passCondHandlers, "emu.grasscutter.game.dungeons.pass_condition", DungeonBaseHandler.class);
}
public <T> void registerHandlers(Int2ObjectMap<T> map, String packageName, Class<T> clazz) {
Reflections reflections = new Reflections(packageName);
var handlerClasses = reflections.getSubTypesOf(clazz);
for (var obj : handlerClasses) {
this.registerPacketHandler(map, obj);
}
}
public <T> void registerPacketHandler(Int2ObjectMap<T> map, Class<? extends T> handlerClass) {
try {
DungeonValue opcode = handlerClass.getAnnotation(DungeonValue.class);
if (opcode == null || opcode.value() == null) {
return;
}
map.put(opcode.value().ordinal(), handlerClass.getDeclaredConstructor().newInstance());
} catch (Exception e) {
e.printStackTrace();
}
}
public void getEntryInfo(Player player, int pointId) {
@ -38,6 +78,17 @@ public class DungeonSystem extends BaseGameSystem {
player.sendPacket(new PacketDungeonEntryInfoRsp(player, entry.getPointData()));
}
public boolean triggerCondition(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
var handler = passCondHandlers.get(condition.getCondType().ordinal());
if (handler == null) {
Grasscutter.getLogger().debug("Could not trigger condition {} at {}", condition.getCondType(), params);
return false;
}
return handler.execute(condition, params);
}
public boolean enterDungeon(Player player, int pointId, int dungeonId) {
DungeonData data = GameData.getDungeonDataMap().get(dungeonId);
@ -47,14 +98,17 @@ public class DungeonSystem extends BaseGameSystem {
Grasscutter.getLogger().info("{}({}) is trying to enter dungeon {}" ,player.getNickname(),player.getUid(),dungeonId);
int sceneId = data.getSceneId();
player.getScene().setPrevScene(sceneId);
var scene = player.getScene();
scene.setPrevScene(sceneId);
if (player.getWorld().transferPlayerToScene(player, sceneId, data)) {
player.getScene().addDungeonSettleObserver(basicDungeonSettleObserver);
player.getQuestManager().triggerEvent(QuestTrigger.QUEST_CONTENT_ENTER_DUNGEON, data.getId());
scene = player.getScene();
var dungeonManager = new DungeonManager(scene, data);
dungeonManager.startDungeon();
scene.addDungeonSettleObserver(basicDungeonSettleObserver);
}
player.getScene().setPrevScenePoint(pointId);
scene.setPrevScenePoint(pointId);
player.sendPacket(new PacketPlayerEnterDungeonRsp(pointId, dungeonId));
return true;
}
@ -87,7 +141,8 @@ public class DungeonSystem extends BaseGameSystem {
int prevScene = scene.getPrevScene() > 0 ? scene.getPrevScene() : 3;
// Get previous position
DungeonData dungeonData = scene.getDungeonData();
var dungeonManager = scene.getDungeonManager();
DungeonData dungeonData = dungeonManager != null ? dungeonManager.getDungeonData() : null;
Position prevPos = new Position(GameConstants.START_POSITION);
if (dungeonData != null) {

View File

@ -0,0 +1,39 @@
package emu.grasscutter.game.dungeons;
import lombok.Getter;
public enum DungeonType {
DUNGEON_NONE(false),
DUNGEON_PLOT(true),
DUNGEON_FIGHT(true),
DUNGEON_THEATRE_MECHANICUS(false),
DUNGEON_BOSS(true),
DUNGEON_DREAMLAND(false),
DUNGEON_UGC(false),
DUNGEON_POTION(false),
DUNGEON_SUMO_COMBAT(false),
DUNGEON_ROGUELIKE(false),
DUNGEON_CRYSTAL_LINK(false),
DUNGEON_TOWER(false),
DUNGEON_DISCARDED(false),
DUNGEON_ELEMENT_CHALLENGE(true),
DUNGEON_EFFIGY(false),
DUNGEON_DAILY_FIGHT(false),
DUNGEON_FLEUR_FAIR(false),
DUNGEON_ACTIVITY(false),
DUNGEON_CHANNELLER_SLAB_ONE_OFF(false),
DUNGEON_CHANNELLER_SLAB_LOOP(false),
DUNGEON_MINI_ELDRITCH(false),
DUNGEON_CHESS(false),
DUNGEON_IRODORI_CHESS(false),
DUNGEON_ROGUE_DIARY(false),
DUNGEON_SUMMER_V2(true),
DUNGEON_MUQADAS_POTION(false),
DUNGEON_INSTABLE_SPRAY(false);
@Getter private final boolean countsToBattlepass;
DungeonType(boolean countsToBattlepass){
this.countsToBattlepass = countsToBattlepass;
}
}

View File

@ -0,0 +1,9 @@
package emu.grasscutter.game.dungeons;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface DungeonValue {
DungeonPassConditionType value();
}

View File

@ -0,0 +1,17 @@
package emu.grasscutter.game.dungeons;
import lombok.Getter;
public enum SettleShowType {
SETTLE_SHOW_NONE(0),
SETTLE_SHOW_TIME_COST(1),
SETTLE_SHOW_OPEN_CHEST_COUNT(2),
SETTLE_SHOW_KILL_MONSTER_COUNT(3),
SETTLE_SHOW_BLACKSCREEN(4);
@Getter private final int id;
SettleShowType(int id){
this.id = id;
}
}

View File

@ -1,19 +1,21 @@
package emu.grasscutter.game.dungeons;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult.DungeonEndReason;
import emu.grasscutter.game.dungeons.dungeon_results.TowerResult;
import emu.grasscutter.server.packet.send.PacketDungeonSettleNotify;
import emu.grasscutter.server.packet.send.PacketTowerFloorRecordChangeNotify;
import emu.grasscutter.utils.Utils;
public class TowerDungeonSettleListener implements DungeonSettleListener {
@Override
public void onDungeonSettle(Scene scene) {
public void onDungeonSettle(DungeonManager dungeonManager, DungeonEndReason endReason) {
var scene = dungeonManager.getScene();
var dungeonData = dungeonManager.getDungeonData();
if(scene.getScriptManager().getVariables().containsKey("stage")
&& scene.getScriptManager().getVariables().get("stage") == 1){
return;
}
scene.setAutoCloseTime(Utils.getCurrentSeconds() + 1000);
var towerManager = scene.getPlayers().get(0).getTowerManager();
towerManager.notifyCurLevelRecordChangeWhenDone(3);
@ -23,12 +25,11 @@ public class TowerDungeonSettleListener implements DungeonSettleListener {
towerManager.canEnterScheduleFloor()
));
scene.broadcastPacket(new PacketDungeonSettleNotify(
scene.getChallenge(),
towerManager.hasNextFloor(),
towerManager.hasNextLevel(),
towerManager.hasNextLevel() ? 0 : towerManager.getNextFloorId()
));
var challenge = scene.getChallenge();
var dungeonStats = new DungeonEndStats(scene.getKilledMonsterCount(), challenge.getFinishedTime(), 0, endReason);
var result = new TowerResult(dungeonData, dungeonStats, towerManager, challenge);
scene.broadcastPacket(new PacketDungeonSettleNotify(result));
}
}

View File

@ -1,33 +1,13 @@
package emu.grasscutter.game.dungeons.challenge;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.DataLoader;
import emu.grasscutter.data.common.ItemParamData;
import emu.grasscutter.data.excels.DungeonData;
import emu.grasscutter.game.dungeons.DungeonDrop;
import emu.grasscutter.game.dungeons.DungeonDropEntry;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.challenge.trigger.ChallengeTrigger;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.ActionReason;
import emu.grasscutter.game.props.WatcherTriggerType;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.net.proto.GadgetInteractReqOuterClass.GadgetInteractReq;
import emu.grasscutter.net.proto.ResinCostTypeOuterClass;
import emu.grasscutter.scripts.constants.EventType;
import emu.grasscutter.scripts.data.SceneGroup;
import emu.grasscutter.scripts.data.ScriptArgs;
import emu.grasscutter.server.packet.send.PacketGadgetAutoPickDropInfoNotify;
import emu.grasscutter.utils.Utils;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
import it.unimi.dsi.fastutil.ints.IntSet;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class DungeonChallenge extends WorldChallenge {
@ -35,22 +15,6 @@ public class DungeonChallenge extends WorldChallenge {
* has more challenge
*/
private boolean stage;
private IntSet rewardedPlayers;
private final static Int2ObjectMap<List<DungeonDropEntry>> dungeonDropData = new Int2ObjectOpenHashMap<>();
public static void initialize() {
// Read the data we need for dungeon rewards drops.
try {
DataLoader.loadList("DungeonDrop.json", DungeonDrop.class).forEach(entry -> {
dungeonDropData.put(entry.getDungeonId(), entry.getDrops());
});
Grasscutter.getLogger().debug("Loaded {} dungeon drop data entries.", dungeonDropData.size());
}
catch (Exception ex) {
Grasscutter.getLogger().error("Unable to load dungeon drop data.", ex);
}
}
public DungeonChallenge(Scene scene, SceneGroup group,
int challengeId, int challengeIndex,
@ -58,7 +22,6 @@ public class DungeonChallenge extends WorldChallenge {
int timeLimit, int goal,
List<ChallengeTrigger> challengeTriggers) {
super(scene, group, challengeId, challengeIndex, paramList, timeLimit, goal, challengeTriggers);
this.setRewardedPlayers(new IntOpenHashSet());
}
public boolean isStage() {
@ -69,17 +32,10 @@ public class DungeonChallenge extends WorldChallenge {
this.stage = stage;
}
public IntSet getRewardedPlayers() {
return rewardedPlayers;
}
public void setRewardedPlayers(IntSet rewardedPlayers) {
this.rewardedPlayers = rewardedPlayers;
}
@Override
public void done() {
super.done();
getScene().triggerDungeonEvent(DungeonPassConditionType.DUNGEON_COND_FINISH_CHALLENGE, getChallengeId(), getChallengeIndex());
if (this.isSuccess()) {
// Settle
settle();
@ -89,110 +45,12 @@ public class DungeonChallenge extends WorldChallenge {
private void settle() {
if (!stage) {
var scene = this.getScene();
scene.getDungeonSettleListeners().forEach(o -> o.onDungeonSettle(getScene()));
scene.getScriptManager().callEvent(EventType.EVENT_DUNGEON_SETTLE,
new ScriptArgs(this.isSuccess() ? 1 : 0));
// Battle pass trigger
scene.getPlayers().forEach(p -> p.getBattlePassManager().triggerMission(WatcherTriggerType.TRIGGER_FINISH_DUNGEON));
if(this.isSuccess()){
scene.getDungeonManager().finishDungeon();
} else {
scene.getDungeonManager().failDungeon();
}
}
}
private List<GameItem> rollRewards(boolean useCondensed) {
List<GameItem> rewards = new ArrayList<>();
int dungeonId = this.getScene().getDungeonData().getId();
// If we have specific drop data for this dungeon, we use it.
if (dungeonDropData.containsKey(dungeonId)) {
List<DungeonDropEntry> dropEntries = dungeonDropData.get(dungeonId);
// Roll for each drop group.
for (var entry : dropEntries) {
// Determine the number of drops we get for this entry.
int start = entry.getCounts().get(0);
int end = entry.getCounts().get(entry.getCounts().size() - 1);
var candidateAmounts = IntStream.range(start, end + 1).boxed().collect(Collectors.toList());
int amount = Utils.drawRandomListElement(candidateAmounts, entry.getProbabilities());
if (useCondensed) {
amount += Utils.drawRandomListElement(candidateAmounts, entry.getProbabilities());
}
// Double rewards in multiplay mode, if specified.
if (entry.isMpDouble() && this.getScene().getPlayerCount() > 1) {
amount *= 2;
}
// Roll items for this group.
// Here, we have to handle stacking, or the client will not display results correctly.
// For now, we use the following logic: If the possible drop item are a list of multiple items,
// we roll them separately. If not, we stack them. This should work out in practice, at least
// for the currently existing set of dungeons.
if (entry.getItems().size() == 1) {
rewards.add(new GameItem(entry.getItems().get(0), amount));
}
else {
for (int i = 0; i < amount; i++) {
// int itemIndex = ThreadLocalRandom.current().nextInt(0, entry.getItems().size());
// int itemId = entry.getItems().get(itemIndex);
int itemId = Utils.drawRandomListElement(entry.getItems(), entry.getItemProbabilities());
rewards.add(new GameItem(itemId, 1));
}
}
}
}
// Otherwise, we fall back to the preview data.
else {
Grasscutter.getLogger().info("No drop data found or dungeon {}, falling back to preview data ...", dungeonId);
for (ItemParamData param : getScene().getDungeonData().getRewardPreview().getPreviewItems()) {
rewards.add(new GameItem(param.getId(), Math.max(param.getCount(), 1)));
}
}
return rewards;
}
public void getStatueDrops(Player player, GadgetInteractReq request) {
DungeonData dungeonData = getScene().getDungeonData();
int resinCost = dungeonData.getStatueCostCount() != 0 ? dungeonData.getStatueCostCount() : 20;
if (!isSuccess() || dungeonData == null || dungeonData.getRewardPreview() == null || dungeonData.getRewardPreview().getPreviewItems().length == 0) {
return;
}
// Already rewarded
if (getRewardedPlayers().contains(player.getUid())) {
return;
}
// Get rewards.
List<GameItem> rewards = new ArrayList<>();
if (request.getResinCostType() == ResinCostTypeOuterClass.ResinCostType.RESIN_COST_TYPE_CONDENSE) {
// Check if condensed resin is usable here.
// For this, we use the following logic for now:
// The normal resin cost of the dungeon has to be 20.
if (resinCost != 20) {
return;
}
// Spend the condensed resin and only proceed if the transaction succeeds.
if (!player.getResinManager().useCondensedResin(1)) return;
// Roll rewards.
rewards.addAll(this.rollRewards(true));
}
else {
// Spend the resin and only proceed if the transaction succeeds.
if (!player.getResinManager().useResin(resinCost)) return;
// Roll rewards.
rewards.addAll(this.rollRewards(false));
}
// Add rewards to player and send notification.
player.getInventory().addItems(rewards, ActionReason.DungeonStatueDrop);
player.sendPacket(new PacketGadgetAutoPickDropInfoNotify(rewards));
getRewardedPlayers().add(player.getUid());
}
}

View File

@ -0,0 +1,74 @@
package emu.grasscutter.game.dungeons.dungeon_results;
import emu.grasscutter.data.excels.DungeonData;
import emu.grasscutter.game.dungeons.DungeonEndStats;
import emu.grasscutter.net.proto.DungeonSettleNotifyOuterClass.DungeonSettleNotify;
import emu.grasscutter.net.proto.ParamListOuterClass;
import emu.grasscutter.utils.Utils;
import lombok.Getter;
public class BaseDungeonResult {
@Getter DungeonData dungeonData;
@Getter
DungeonEndStats dungeonStats;
public BaseDungeonResult(DungeonData dungeonData, DungeonEndStats dungeonStats){
this.dungeonData = dungeonData;
this.dungeonStats = dungeonStats;
}
protected void onProto(DungeonSettleNotify.Builder builder){ }
public final DungeonSettleNotify.Builder getProto(){
var success = dungeonStats.getDungeonResult().isSuccess();
var builder = DungeonSettleNotify.newBuilder()
.setDungeonId(dungeonData.getId())
.setIsSuccess(success)
.setCloseTime(getCloseTime())
.setResult(success ? 1 : 0);
// TODO check
if(dungeonData.getSettleShows()!=null) {
for (int i = 0; i < dungeonData.getSettleShows().size(); i++) {
var settle = dungeonData.getSettleShows().get(i);
builder.putSettleShow(i + 1,switch (settle) {
case SETTLE_SHOW_TIME_COST -> ParamListOuterClass.ParamList.newBuilder()
.addParamList(settle.getId())
.addParamList(dungeonStats.getTimeTaken())
.build();
case SETTLE_SHOW_KILL_MONSTER_COUNT -> ParamListOuterClass.ParamList.newBuilder()
.addParamList(settle.getId())
.addParamList(dungeonStats.getKilledMonsters())
.build();
default -> ParamListOuterClass.ParamList.newBuilder()
.addParamList(settle.getId())
.build();
});
}
}
//TODO handle settle show
onProto(builder);
return builder;
}
public int getCloseTime(){
return Utils.getCurrentSeconds() + switch (dungeonStats.getDungeonResult()){
case COMPLETED -> dungeonData.getSettleCountdownTime();
case FAILED -> dungeonData.getFailSettleCountdownTime();
case QUIT -> dungeonData.getQuitSettleCountdownTime();
};
}
public enum DungeonEndReason{
COMPLETED,
FAILED,
QUIT;
public boolean isSuccess(){
return this == COMPLETED;
}
}
}

View File

@ -0,0 +1,50 @@
package emu.grasscutter.game.dungeons.dungeon_results;
import emu.grasscutter.data.excels.DungeonData;
import emu.grasscutter.game.dungeons.DungeonEndStats;
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
import emu.grasscutter.game.tower.TowerManager;
import emu.grasscutter.net.proto.DungeonSettleExhibitionInfoOuterClass;
import emu.grasscutter.net.proto.DungeonSettleNotifyOuterClass;
import emu.grasscutter.net.proto.ItemParamOuterClass;
import emu.grasscutter.net.proto.TowerLevelEndNotifyOuterClass.TowerLevelEndNotify.ContinueStateType;
import emu.grasscutter.net.proto.TowerLevelEndNotifyOuterClass.TowerLevelEndNotify;
public class TowerResult extends BaseDungeonResult{
WorldChallenge challenge;
boolean canJump;
boolean hasNextLevel;
int nextFloorId;
public TowerResult(DungeonData dungeonData, DungeonEndStats dungeonStats, TowerManager towerManager, WorldChallenge challenge) {
super(dungeonData, dungeonStats);
this.challenge = challenge;
this.canJump = towerManager.hasNextFloor();
this.hasNextLevel = towerManager.hasNextLevel();
this.nextFloorId = hasNextLevel ? 0 : towerManager.getNextFloorId();
}
@Override
protected void onProto(DungeonSettleNotifyOuterClass.DungeonSettleNotify.Builder builder) {
var continueStatus = ContinueStateType.CONTINUE_STATE_TYPE_CAN_NOT_CONTINUE_VALUE;
if(challenge.isSuccess() && canJump){
continueStatus = hasNextLevel ? ContinueStateType.CONTINUE_STATE_TYPE_CAN_ENTER_NEXT_LEVEL_VALUE
: ContinueStateType.CONTINUE_STATE_TYPE_CAN_ENTER_NEXT_FLOOR_VALUE;
}
var towerLevelEndNotify = TowerLevelEndNotify.newBuilder()
.setIsSuccess(challenge.isSuccess())
.setContinueState(continueStatus)
.addFinishedStarCondList(1)
.addFinishedStarCondList(2)
.addFinishedStarCondList(3)
.addRewardItemList(ItemParamOuterClass.ItemParam.newBuilder()
.setItemId(201)
.setCount(1000)
.build())
;
if(nextFloorId > 0 && canJump){
towerLevelEndNotify.setNextFloorId(nextFloorId);
}
builder.setTowerLevelEndNotify(towerLevelEndNotify);
}
}

View File

@ -0,0 +1,23 @@
package emu.grasscutter.game.dungeons.dungeon_results;
import emu.grasscutter.data.excels.DungeonData;
import emu.grasscutter.game.dungeons.DungeonEndStats;
import emu.grasscutter.net.proto.DungeonSettleNotifyOuterClass;
import emu.grasscutter.net.proto.TrialAvatarFirstPassDungeonNotifyOuterClass.TrialAvatarFirstPassDungeonNotify;
public class TrialAvatarDungeonResult extends BaseDungeonResult {
int trialCharacterIndexId;
public TrialAvatarDungeonResult(DungeonData dungeonData, DungeonEndStats dungeonStats, int trialCharacterIndexId) {
super(dungeonData, dungeonStats);
this.trialCharacterIndexId = trialCharacterIndexId;
}
@Override
protected void onProto(DungeonSettleNotifyOuterClass.DungeonSettleNotify.Builder builder) {
if (dungeonStats.getDungeonResult() == DungeonEndReason.COMPLETED) { //TODO check if its the first pass(?)
builder.setTrialAvatarFirstPassDungeonNotify(TrialAvatarFirstPassDungeonNotify.newBuilder()
.setTrialAvatarIndexId(trialCharacterIndexId));
}
}
}

View File

@ -0,0 +1,12 @@
package emu.grasscutter.game.dungeons.handlers;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.data.excels.QuestData.QuestCondition;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.quest.GameQuest;
public abstract class DungeonBaseHandler {
public abstract boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params);
}

View File

@ -0,0 +1,23 @@
package emu.grasscutter.game.dungeons.pass_condition;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonValue;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.quest.QuestValue;
import emu.grasscutter.data.excels.QuestData.QuestCondition;
import emu.grasscutter.game.quest.GameQuest;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.quest.handlers.QuestBaseHandler;
@DungeonValue(DungeonPassConditionType.DUNGEON_COND_NONE)
public class BaseCondition extends DungeonBaseHandler {
@Override
public boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
// TODO Auto-generated method stub
return false;
}
}

View File

@ -0,0 +1,15 @@
package emu.grasscutter.game.dungeons.pass_condition;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonValue;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
@DungeonValue(DungeonPassConditionType.DUNGEON_COND_FINISH_CHALLENGE)
public class ConditionFinishChallenge extends DungeonBaseHandler {
@Override
public boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
return params[0] == condition.getParam()[0] || params[1] == condition.getParam()[0];
}
}

View File

@ -0,0 +1,15 @@
package emu.grasscutter.game.dungeons.pass_condition;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonValue;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
@DungeonValue(DungeonPassConditionType.DUNGEON_COND_FINISH_QUEST)
public class ConditionFinishQuest extends DungeonBaseHandler {
@Override
public boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
return params[0] == condition.getParam()[0];
}
}

View File

@ -0,0 +1,15 @@
package emu.grasscutter.game.dungeons.pass_condition;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonValue;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
@DungeonValue(DungeonPassConditionType.DUNGEON_COND_IN_TIME)
public class ConditionInTime extends DungeonBaseHandler {
@Override
public boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
return params[0] <= condition.getParam()[0];
}
}

View File

@ -0,0 +1,15 @@
package emu.grasscutter.game.dungeons.pass_condition;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonValue;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
@DungeonValue(DungeonPassConditionType.DUNGEON_COND_KILL_GROUP_MONSTER)
public class ConditionKillGroupMonster extends DungeonBaseHandler {
@Override
public boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
return params[0] == condition.getParam()[0];
}
}

View File

@ -0,0 +1,15 @@
package emu.grasscutter.game.dungeons.pass_condition;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonValue;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
@DungeonValue(DungeonPassConditionType.DUNGEON_COND_KILL_MONSTER)
public class ConditionKillMonster extends DungeonBaseHandler {
@Override
public boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
return params[0] == condition.getParam()[0];
}
}

View File

@ -0,0 +1,15 @@
package emu.grasscutter.game.dungeons.pass_condition;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonValue;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
@DungeonValue(DungeonPassConditionType.DUNGEON_COND_KILL_MONSTER_COUNT)
public class ConditionKillMonsterCount extends DungeonBaseHandler {
@Override
public boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
return params[0] >= condition.getParam()[0];
}
}

View File

@ -0,0 +1,15 @@
package emu.grasscutter.game.dungeons.pass_condition;
import emu.grasscutter.data.excels.DungeonPassConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonValue;
import emu.grasscutter.game.dungeons.handlers.DungeonBaseHandler;
@DungeonValue(DungeonPassConditionType.DUNGEON_COND_KILL_TYPE_MONSTER)
public class ConditionKillTypeMonster extends DungeonBaseHandler {
@Override
public boolean execute(DungeonPassConfigData.DungeonPassCondition condition, int... params) {
return params[0] == condition.getParam()[0];
}
}

View File

@ -4,6 +4,9 @@ import emu.grasscutter.data.binout.ConfigGadget;
import emu.grasscutter.game.props.FightProperty;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.game.world.Scene;
import emu.grasscutter.scripts.data.ScriptArgs;
import static emu.grasscutter.scripts.constants.EventType.EVENT_SPECIFIC_GADGET_HP_CHANGE;
public abstract class EntityBaseGadget extends GameEntity {
@ -20,6 +23,21 @@ public abstract class EntityBaseGadget extends GameEntity {
getScene().getPlayers().forEach(p -> p.getQuestManager().triggerEvent(QuestTrigger.QUEST_CONTENT_DESTROY_GADGET, this.getGadgetId()));
}
@Override
public void damage(float amount, int killerId) {
super.damage(amount, killerId);
if(this.getFightProperties() == null){
return;
}
float hpAfterDamage = this.getFightProperty(FightProperty.FIGHT_PROP_CUR_HP);
// param2 unused for now
getScene().getScriptManager().callEvent(EVENT_SPECIFIC_GADGET_HP_CHANGE, new ScriptArgs(getConfigId(), getGadgetId())
.setSourceEntityId(getId())
.setParam3((int)hpAfterDamage)
.setEventSource(Integer.toString(getConfigId())));
}
protected void fillFightProps(ConfigGadget configGadget) {
if (configGadget == null || configGadget.getCombat() == null) {
return;

View File

@ -1,5 +1,6 @@
package emu.grasscutter.game.entity;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.data.GameData;
import emu.grasscutter.data.binout.ConfigGadget;
import emu.grasscutter.data.excels.GadgetData;
@ -143,7 +144,7 @@ public class EntityGadget extends EntityBaseGadget {
GadgetContent content = switch (type) {
case GatherPoint -> new GadgetGatherPoint(this);
case GatherObject -> new GadgetGatherObject(this);
case Worktop -> new GadgetWorktop(this);
case Worktop, SealGadget -> new GadgetWorktop(this);
case RewardStatue -> new GadgetRewardStatue(this);
case Chest -> new GadgetChest(this);
case Gadget -> new GadgetObject(this);

View File

@ -8,6 +8,7 @@ import emu.grasscutter.data.excels.EnvAnimalGatherConfigData;
import emu.grasscutter.data.excels.ItemData;
import emu.grasscutter.data.excels.MonsterCurveData;
import emu.grasscutter.data.excels.MonsterData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.ActionReason;
@ -41,6 +42,8 @@ import it.unimi.dsi.fastutil.ints.Int2FloatOpenHashMap;
import lombok.Getter;
import lombok.Setter;
import static emu.grasscutter.scripts.constants.EventType.EVENT_SPECIFIC_MONSTER_HP_CHANGE;
public class EntityMonster extends GameEntity {
private final MonsterData monsterData;
private final Int2FloatOpenHashMap fightProp;
@ -159,6 +162,12 @@ public class EntityMonster extends GameEntity {
for (Player player : this.getScene().getPlayers()) {
player.getEnergyManager().handleMonsterEnergyDrop(this, hpBeforeDamage, hpAfterDamage);
}
// param2 unused for now
getScene().getScriptManager().callEvent(EVENT_SPECIFIC_MONSTER_HP_CHANGE, new ScriptArgs(getConfigId(), monsterData.getId())
.setSourceEntityId(getId())
.setParam3((int)hpAfterDamage)
.setEventSource(Integer.toString(getConfigId())));
}
@Override
@ -187,6 +196,10 @@ public class EntityMonster extends GameEntity {
getScene().getPlayers().forEach(p -> p.getBattlePassManager().triggerMission(WatcherTriggerType.TRIGGER_MONSTER_DIE, this.getMonsterId(), 1));
getScene().getPlayers().forEach(p -> p.getQuestManager().triggerEvent(QuestTrigger.QUEST_CONTENT_MONSTER_DIE, this.getMonsterId()));
getScene().getPlayers().forEach(p -> p.getQuestManager().triggerEvent(QuestTrigger.QUEST_CONTENT_KILL_MONSTER, this.getMonsterId()));
getScene().triggerDungeonEvent(DungeonPassConditionType.DUNGEON_COND_KILL_GROUP_MONSTER, this.getGroupId());
getScene().triggerDungeonEvent(DungeonPassConditionType.DUNGEON_COND_KILL_TYPE_MONSTER, this.getMonsterData().getType().getValue());
getScene().triggerDungeonEvent(DungeonPassConditionType.DUNGEON_COND_KILL_MONSTER, this.getMonsterId());
}
public void recalcStats() {

View File

@ -5,26 +5,28 @@ import emu.grasscutter.game.entity.EntityGadget;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.proto.GadgetInteractReqOuterClass.GadgetInteractReq;
import emu.grasscutter.net.proto.InteractTypeOuterClass.InteractType;
import emu.grasscutter.net.proto.ResinCostTypeOuterClass;
import emu.grasscutter.net.proto.SceneGadgetInfoOuterClass.SceneGadgetInfo;
import emu.grasscutter.server.packet.send.PacketGadgetInteractRsp;
public class GadgetRewardStatue extends GadgetContent {
public GadgetRewardStatue(EntityGadget gadget) {
super(gadget);
}
public boolean onInteract(Player player, GadgetInteractReq req) {
if (player.getScene().getChallenge() != null && player.getScene().getChallenge() instanceof DungeonChallenge dungeonChallenge) {
dungeonChallenge.getStatueDrops(player, req);
if (player.getScene().getDungeonManager() != null || player.getScene().getChallenge() instanceof DungeonChallenge dungeonChallenge) {
var useCondensed = req.getResinCostType() == ResinCostTypeOuterClass.ResinCostType.RESIN_COST_TYPE_CONDENSE;
player.getScene().getDungeonManager().getStatueDrops(player, useCondensed);
}
player.sendPacket(new PacketGadgetInteractRsp(getGadget(), InteractType.INTERACT_TYPE_OPEN_STATUE));
return false;
}
public void onBuildProto(SceneGadgetInfo.Builder gadgetInfo) {
}
}

View File

@ -35,6 +35,11 @@ public class BossChestInteractHandler implements ChestInteractHandler{
var reward = worldDataManager.getRewardByBossId(monster.monster_id);
if (reward == null) {
var dungeonManager = player.getScene().getDungeonManager();
if(dungeonManager != null){
return dungeonManager.getStatueDrops(player, useCondensedResin);
}
Grasscutter.getLogger().warn("Could not found the reward of boss monster {}", monster.monster_id);
return false;
}

View File

@ -1160,6 +1160,9 @@ public class Player {
// Execute daily reset logic if this is a new day.
this.doDailyReset();
// Activity needed for some quests
activityManager = new ActivityManager(this);
// Rewind active quests, and put the player to a rewind position it finds (if any) of an active quest
getQuestManager().onLogin();
@ -1192,8 +1195,6 @@ public class Player {
// Home
home = GameHome.getByUid(getUid());
home.onOwnerLogin(this);
// Activity
activityManager = new ActivityManager(this);
session.send(new PacketPlayerEnterSceneNotify(this)); // Enter game world
session.send(new PacketPlayerLevelRewardUpdateNotify(rewardedLevels));

View File

@ -12,6 +12,7 @@ import emu.grasscutter.game.quest.enums.QuestState;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.net.proto.PropChangeReasonOuterClass.PropChangeReason;
import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
import emu.grasscutter.scripts.data.ScriptArgs;
import emu.grasscutter.server.packet.send.PacketOpenStateChangeNotify;
import emu.grasscutter.server.packet.send.PacketOpenStateUpdateNotify;
import emu.grasscutter.server.packet.send.PacketSceneAreaUnlockNotify;
@ -22,6 +23,8 @@ import emu.grasscutter.server.packet.send.PacketUnlockTransPointRsp;
import java.util.*;
import java.util.stream.Collectors;
import static emu.grasscutter.scripts.constants.EventType.EVENT_UNLOCK_TRANS_POINT;
// @Entity
public class PlayerProgressManager extends BasePlayerDataManager {
public PlayerProgressManager(Player player) {
@ -214,8 +217,9 @@ public class PlayerProgressManager extends BasePlayerDataManager {
// this.player.sendPacket(new PacketPlayerPropChangeReasonNotify(this.player.getProperty(PlayerProperty.PROP_PLAYER_EXP), PlayerProperty.PROP_PLAYER_EXP, PropChangeReason.PROP_CHANGE_REASON_PLAYER_ADD_EXP));
// Fire quest trigger for trans point unlock.
// Fire quest and script trigger for trans point unlock.
this.player.getQuestManager().triggerEvent(QuestTrigger.QUEST_CONTENT_UNLOCK_TRANS_POINT, sceneId, pointId);
this.player.getScene().getScriptManager().callEvent(EVENT_UNLOCK_TRANS_POINT, new ScriptArgs(sceneId, pointId));
// Send packet.
this.player.sendPacket(new PacketScenePointUnlockNotify(sceneId, pointId));

View File

@ -7,6 +7,7 @@ import emu.grasscutter.data.GameData;
import emu.grasscutter.data.excels.ChapterData;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.data.excels.TriggerExcelConfigData;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.quest.enums.QuestState;
import emu.grasscutter.game.quest.enums.QuestTrigger;
@ -102,6 +103,7 @@ public class GameQuest {
//Some subQuests and talks become active when some other subQuests are unfinished (even from different MainQuests)
this.getOwner().getQuestManager().triggerEvent(QuestTrigger.QUEST_CONTENT_QUEST_STATE_EQUAL, this.getSubQuestId(), this.getState().getValue(),0,0,0);
this.getOwner().getQuestManager().triggerEvent(QuestTrigger.QUEST_COND_STATE_EQUAL, this.getSubQuestId(), this.getState().getValue(),0,0,0);
this.getOwner().getScene().triggerDungeonEvent(DungeonPassConditionType.DUNGEON_COND_FINISH_QUEST, this.getSubQuestId());
Grasscutter.getLogger().debug("Quest {} is started", subQuestId);
}

View File

@ -62,7 +62,7 @@ public class QuestManager extends BasePlayerManager {
*/
public static long getQuestKey(int mainQuestId) {
public static long getQuestKey(int mainQuestId) {
QuestEncryptionKey questEncryptionKey = GameData.getMainQuestEncryptionMap().get(mainQuestId);
return questEncryptionKey != null ? questEncryptionKey.getEncryptionKey() : 0L;
}

View File

@ -1,8 +1,5 @@
package emu.grasscutter.game.quest;
import java.util.Set;
import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.game.quest.handlers.QuestExecHandler;
import emu.grasscutter.server.game.BaseGameSystem;
import emu.grasscutter.server.game.GameServer;

View File

@ -6,6 +6,8 @@ import emu.grasscutter.data.GameDepot;
import emu.grasscutter.data.binout.SceneNpcBornEntry;
import emu.grasscutter.data.excels.*;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.game.dungeons.DungeonManager;
import emu.grasscutter.game.dungeons.DungeonPassConditionType;
import emu.grasscutter.game.dungeons.DungeonSettleListener;
import emu.grasscutter.game.entity.*;
import emu.grasscutter.game.entity.gadget.GadgetWorktop;
@ -50,15 +52,15 @@ public class Scene {
private Set<SpawnDataEntry.GridBlockId> loadedGridBlocks;
@Getter @Setter private boolean dontDestroyWhenEmpty;
@Getter @Setter private int autoCloseTime;
@Getter private int time;
@Getter private SceneScriptManager scriptManager;
@Getter @Setter private WorldChallenge challenge;
@Getter private List<DungeonSettleListener> dungeonSettleListeners;
@Getter private DungeonData dungeonData;
@Getter @Setter DungeonManager dungeonManager;
@Getter @Setter private int prevScene; // Id of the previous scene
@Getter @Setter private int prevScenePoint;
@Getter @Setter private int killedMonsterCount;
private Set<SceneNpcBornEntry> npcBornEntrySet;
public Scene(World world, SceneData sceneData) {
this.world = world;
@ -105,13 +107,6 @@ public class Scene {
this.time = time % 1440;
}
public void setDungeonData(DungeonData dungeonData) {
if (dungeonData == null || this.dungeonData != null || this.getSceneType() != SceneType.SCENE_DUNGEON || dungeonData.getSceneId() != this.getId()) {
return;
}
this.dungeonData = dungeonData;
}
public void addDungeonSettleObserver(DungeonSettleListener dungeonSettleListener) {
if (dungeonSettleListeners == null) {
dungeonSettleListeners = new ArrayList<>();
@ -119,6 +114,13 @@ public class Scene {
dungeonSettleListeners.add(dungeonSettleListener);
}
public void triggerDungeonEvent(DungeonPassConditionType conditionType, int... params){
if(dungeonManager==null){
return;
}
dungeonManager.triggerEvent(conditionType, params);
}
public boolean isInScene(GameEntity entity) {
return this.entities.containsKey(entity.getId());
}
@ -334,6 +336,7 @@ public class Scene {
// Death event
target.onDeath(attackerId);
triggerDungeonEvent(DungeonPassConditionType.DUNGEON_COND_KILL_MONSTER_COUNT, ++killedMonsterCount);
}
public void onTick() {

View File

@ -6,6 +6,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import emu.grasscutter.game.dungeons.DungeonManager;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.player.Player.SceneLoadState;
import emu.grasscutter.game.props.EnterReason;
@ -33,6 +34,8 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import static emu.grasscutter.server.event.player.PlayerTeleportEvent.TeleportType.SCRIPT;
public class World implements Iterable<Player> {
private final GameServer server;
private final Player owner;
@ -250,10 +253,13 @@ public class World implements Iterable<Player> {
}
Scene newScene = this.getSceneById(sceneId);
newScene.setDungeonData(dungeonData);
newScene.addPlayer(player);
// Dungeon
if(dungeonData!=null){
var dungeonManager = new DungeonManager(newScene, dungeonData);
dungeonManager.startDungeon();
}
SceneConfig config = newScene.getScriptManager().getConfig();
if (teleportTo == null && config != null) {
if (config.born_pos != null) {
@ -271,14 +277,14 @@ public class World implements Iterable<Player> {
player.getPosition().set(teleportTo);
if (oldScene != null) {
if (oldScene != null && newScene != oldScene) {
newScene.setPrevScene(oldScene.getId());
oldScene.setDontDestroyWhenEmpty(false);
}
// Get enter types
EnterType enterType = EnterType.ENTER_TYPE_JUMP;
EnterReason enterReason = EnterReason.TransPoint;
EnterReason enterReason = teleportType == SCRIPT? EnterReason.Lua : EnterReason.TransPoint;
if (dungeonData != null) {
enterType = EnterType.ENTER_TYPE_DUNGEON;
@ -295,7 +301,7 @@ public class World implements Iterable<Player> {
// Teleport packet
player.sendPacket(new PacketPlayerEnterSceneNotify(player, enterType, enterReason, sceneId, teleportTo));
if(teleportType != TeleportType.INTERNAL) {
if(teleportType != TeleportType.INTERNAL && teleportType != SCRIPT) {
player.getQuestManager().triggerEvent(QuestTrigger.QUEST_CONTENT_ANY_MANUAL_TRANSPORT);
}
return true;

View File

@ -138,7 +138,8 @@ public class SceneScriptManager {
if (!suite.sceneTriggers.isEmpty()) {
groupSceneTriggers.addAll(suite.sceneTriggers);
for (var trigger : groupSceneTriggers) {
this.currentTriggers.get(trigger.event).add(trigger);
this.currentTriggers.computeIfAbsent(trigger.event, k -> new HashSet<>())
.add(trigger);
}
}
triggersByGroupScene.put(group.id+"_"+suiteIndex, groupSceneTriggers);
@ -323,7 +324,15 @@ public class SceneScriptManager {
if (suite == null || group.monsters == null || suite.sceneMonsters.size() <= 0) {
return;
}
this.addEntities(suite.sceneMonsters.stream()
var monstersToSpawn = suite.sceneMonsters.stream()
.filter(m -> {
var entity = scene.getEntityByConfigId(m.config_id);
return entity == null || entity.getGroupId()!=group.id;
});//TODO check if it interferes with bigworld or anything else
if(monstersToSpawn.findAny().isEmpty()){
return;
}
this.addEntities(monstersToSpawn
.map(mob -> createMonster(group.id, group.block_id, mob)).toList());
}
@ -340,7 +349,12 @@ public class SceneScriptManager {
}
public void spawnMonstersByConfigId(SceneGroup group, int configId, int delayTime) {
// TODO delay
var entity = createMonster(group.id, group.block_id, group.monsters.get(configId));
var entity = scene.getEntityByConfigId(configId);
if(entity!=null && entity.getGroupId() == group.id){
Grasscutter.getLogger().info("entity already exists failed in group {} with config {}", group.id, configId);
return;
}
entity = createMonster(group.id, group.block_id, group.monsters.get(configId));
if(entity!=null){
getScene().addEntity(entity);
} else {
@ -364,7 +378,8 @@ public class SceneScriptManager {
Set<SceneTrigger> relevantTriggers = new HashSet<>();
if (eventType == EventType.EVENT_ENTER_REGION || eventType == EventType.EVENT_LEAVE_REGION) {
List<SceneTrigger> relevantTriggersList = this.getTriggersByEvent(eventType).stream()
.filter(p -> p.condition.contains(String.valueOf(params.param1))).toList();
.filter(p -> p.condition.contains(String.valueOf(params.param1)) &&
(p.source.isEmpty() || p.source.equals(params.getEventSource()))).toList();
relevantTriggers = new HashSet<>(relevantTriggersList);
} else {relevantTriggers =new HashSet<>(this.getTriggersByEvent(eventType));}
for (SceneTrigger trigger : relevantTriggers) {
@ -399,6 +414,9 @@ public class SceneScriptManager {
deregisterRegion(region.getMetaRegion());
}
if(ret.isboolean() && ret.checkboolean() || ret.isint() && ret.checkint()==0) {
if(eventType == EVENT_TIMER_EVENT){
cancelGroupTimerEvent(trigger.currentGroup.id, trigger.source);
}
deregisterTrigger(trigger);
}
return true;
@ -498,8 +516,8 @@ public class SceneScriptManager {
// Calculate level
int level = monster.level;
if (getScene().getDungeonData() != null) {
level = getScene().getDungeonData().getShowLevel();
if (getScene().getDungeonManager() != null) {
level = getScene().getDungeonManager().getLevelForMonster(monster.config_id);
} else if (getScene().getWorld().getWorldLevel() > 0) {
WorldLevelData worldLevelData = GameData.getWorldLevelDataMap().get(getScene().getWorld().getWorldLevel());
@ -575,7 +593,9 @@ public class SceneScriptManager {
if(trigger.event == EVENT_TIMER_EVENT &&trigger.source.equals(source)){
Grasscutter.getLogger().warn("[LUA] Found timer trigger with source {} for group {} : {}",
source, groupID, trigger.name);
var taskIdentifier = Grasscutter.getGameServer().getScheduler().scheduleDelayedRepeatingTask(() -> callEvent(EVENT_TIMER_EVENT, new ScriptArgs()), (int)time, (int)time);
var taskIdentifier = Grasscutter.getGameServer().getScheduler().scheduleDelayedRepeatingTask(() ->
callEvent(EVENT_TIMER_EVENT, new ScriptArgs()
.setEventSource(source)), (int)time, (int)time);
var groupTasks = activeGroupTimers.computeIfAbsent(groupID, k -> new HashSet<>());
groupTasks.add(new Pair<>(source, taskIdentifier));

View File

@ -1,5 +1,7 @@
package emu.grasscutter.scripts;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.activity.ActivityManager;
import emu.grasscutter.game.dungeons.challenge.DungeonChallenge;
import emu.grasscutter.game.dungeons.challenge.factory.ChallengeFactory;
import emu.grasscutter.game.entity.*;
@ -8,14 +10,17 @@ import emu.grasscutter.game.props.ClimateType;
import emu.grasscutter.game.props.EntityType;
import emu.grasscutter.game.quest.enums.QuestState;
import emu.grasscutter.game.quest.enums.QuestTrigger;
import emu.grasscutter.net.proto.EnterTypeOuterClass;
import emu.grasscutter.net.proto.EntityMoveInfoOuterClass;
import emu.grasscutter.net.proto.MotionInfoOuterClass;
import emu.grasscutter.net.proto.SceneEntityMoveNotifyOuterClass;
import emu.grasscutter.scripts.constants.GroupKillPolicy;
import emu.grasscutter.scripts.data.SceneGadget;
import emu.grasscutter.scripts.data.SceneGroup;
import emu.grasscutter.scripts.data.SceneObject;
import emu.grasscutter.scripts.data.ScriptArgs;
import emu.grasscutter.server.event.player.PlayerTeleportEvent;
import emu.grasscutter.server.packet.send.PacketCanUseSkillNotify;
import emu.grasscutter.server.packet.send.PacketDungeonShowReminderNotify;
import emu.grasscutter.server.packet.send.PacketWorktopOptionNotify;
import emu.grasscutter.server.packet.send.*;
import emu.grasscutter.utils.Position;
import io.netty.util.concurrent.FastThreadLocal;
import org.luaj.vm2.LuaTable;
@ -25,6 +30,7 @@ import org.slf4j.LoggerFactory;
import java.util.*;
import static emu.grasscutter.game.props.EnterReason.Lua;
import static emu.grasscutter.scripts.constants.GroupKillPolicy.*;
@SuppressWarnings("unused")
@ -128,7 +134,6 @@ public class ScriptLib {
public int SetWorktopOptions(LuaTable table){
logger.debug("[LUA] Call SetWorktopOptions with {}", printTable(table));
// TODO check
var callParams = this.callParams.getIfExists();
var group = this.currentGroup.getIfExists();
if(callParams == null || group == null){
@ -151,7 +156,10 @@ public class ScriptLib {
}
worktop.addWorktopOptions(worktopOptions);
getSceneScriptManager().getScene().broadcastPacket(new PacketWorktopOptionNotify(gadget));
var scene = getSceneScriptManager().getScene();
Grasscutter.getGameServer().getScheduler().scheduleDelayedTask(() -> {
scene.broadcastPacket(new PacketWorktopOptionNotify(gadget));
},1);
return 0;
}
@ -176,7 +184,28 @@ public class ScriptLib {
}
public int DelWorktopOption(int var1){
logger.warn("[LUA] Call unimplemented DelWorktopOption with {}", var1);
// TODO implement
var callParams = this.callParams.getIfExists();
var group = this.currentGroup.getIfExists();
if(callParams == null || group == null){
return 1;
}
var configId = callParams.param1;
var entity = getSceneScriptManager().getScene().getEntityByConfigId(configId);
if (!(entity instanceof EntityGadget gadget)) {
return 1;
}
if (!(gadget.getContent() instanceof GadgetWorktop worktop)) {
return 2;
}
worktop.removeWorktopOption(callParams.param2);
var scene = getSceneScriptManager().getScene();
Grasscutter.getGameServer().getScheduler().scheduleDelayedTask(() -> {
scene.broadcastPacket(new PacketWorktopOptionNotify(gadget));
},1);
return 0;
}
@ -315,6 +344,7 @@ public class ScriptLib {
public int CreateVariable(String type, Object value) {
logger.warn("[LUA] Call unimplemented CreateVariable with {} {}",
type, value);
//TODO implement
switch (type){
case "int":
default:
@ -325,13 +355,13 @@ public class ScriptLib {
public int SetVariableValue(int var1) {
logger.warn("[LUA] Call unimplemented SetVariableValue with {}",
var1);
//TODO var1 type
//TODO implement var1 type
return 0;
}
public int GetVariableValue(int var1) {
logger.warn("[LUA] Call unimplemented GetVariableValue with {}",
var1);
//TODO var1 type
//TODO implement var1 type
return 0;
}
public int GetGroupVariableValue(String var) {
@ -422,17 +452,28 @@ public class ScriptLib {
e.getGroupId() == getCurrentGroup().map(sceneGroup -> sceneGroup.id).orElse(-1))
.count();
}
public int SetMonsterBattleByGroup(int var1, int var2, int var3){
logger.debug("[LUA] Call SetMonsterBattleByGroup with {},{},{}",
var1,var2,var3);
// TODO
public int SetMonsterBattleByGroup(int configId, int groupId) {
logger.debug("[LUA] Call SetMonsterBattleByGroup with {} {}",
configId,groupId);
// TODO implement scene50008_group250008057.lua uses incomplete group numbers
return 0;
}
public int CauseDungeonFail(int var1){
logger.debug("[LUA] Call CauseDungeonFail with {}",
var1);
public int CauseDungeonFail(){
logger.debug("[LUA] Call CauseDungeonFail with");
var scriptManager = sceneScriptManager.getIfExists();
if(scriptManager==null){
return 1;
}
var dungeonManager = scriptManager.getScene().getDungeonManager();
if(dungeonManager==null){
return 2;
}
dungeonManager.failDungeon();
return 0;
}
@ -450,9 +491,9 @@ public class ScriptLib {
return 0;
}
public int SetIsAllowUseSkill(int canUse, int var2){
logger.debug("[LUA] Call SetIsAllowUseSkill with {},{}",
canUse,var2);
public int SetIsAllowUseSkill(int canUse){
logger.debug("[LUA] Call SetIsAllowUseSkill with {}",
canUse);
getSceneScriptManager().getScene().broadcastPacket(new PacketCanUseSkillNotify(canUse == 1));
return 0;
@ -516,14 +557,19 @@ public class ScriptLib {
if (group.isEmpty()) {
return 1;
}
var gadget = group.get().gadgets.get(configId);
var entity = getSceneScriptManager().createGadget(group.get().id, group.get().block_id, gadget);
getSceneScriptManager().addEntity(entity);
createGadget(configId, group.get());
return 0;
}
private GameEntity createGadget(int configId, SceneGroup group){
var gadget = group.gadgets.get(configId);
var entity = getSceneScriptManager().createGadget(group.id, group.block_id, gadget);
getSceneScriptManager().addEntity(entity);
return entity;
}
public int CheckRemainGadgetCountByGroupId(LuaTable table){
logger.debug("[LUA] Call CheckRemainGadgetCountByGroupId with {}",
printTable(table));
@ -553,9 +599,9 @@ public class ScriptLib {
return ((EntityGadget)gadget.get()).getState();
}
public int MarkPlayerAction(int var1, int var2, int var3, int var4){
logger.debug("[LUA] Call MarkPlayerAction with {},{},{},{}",
var1, var2,var3,var4);
public int MarkPlayerAction(int var1, int var2, int var3){
logger.debug("[LUA] Call MarkPlayerAction with {},{},{}",
var1, var2,var3);
return 0;
}
@ -657,9 +703,18 @@ public class ScriptLib {
}
public int[] GetSceneUidList(){
logger.warn("[LUA] Call unimplemented GetSceneUidList");
//TODO implement
return new int[]{};
logger.warn("[LUA] Call unchecked GetSceneUidList");
//TODO check
var scriptManager = sceneScriptManager.getIfExists();
if(scriptManager == null){
return new int[0];
}
var players = scriptManager.getScene().getPlayers();
var result = new int[players.size()];
for(int i = 0; i< players.size(); i++){
result[i] = players.get(i).getUid();
}
return result;
}
public int GetSeaLampActivityPhase(){
logger.warn("[LUA] Call unimplemented GetSeaLampActivityPhase");
@ -808,6 +863,12 @@ public class ScriptLib {
return 0;
}
public int StartSealBattle(int gadgetId, LuaTable var2){
logger.warn("[LUA] unimplemented Call StartSealBattle with {} {}", gadgetId, printTable(var2));
//TODO implement var2 containt int radius, int battle_time, int monster_group_id, int default_kill_charge, int auto_charge, int auto_decline, int max_energy, SealBattleType battleType
return 0;
}
public int InitTimeAxis(String var1, int[] var2, boolean var3){
logger.warn("[LUA] Call unimplemented InitTimeAxis with {} {} {}", var1, var2, var3);
//TODO implement
@ -834,7 +895,7 @@ public class ScriptLib {
public int CreateMonsterFaceAvatar(LuaTable var1){
logger.warn("[LUA] Call unimplemented CreateMonsterFaceAvatar with {}", printTable(var1));
//TODO implement var1 contains int entity_id, int[] monsters, int[] ranges, int angle
//TODO implement var1 contains int entity_id, int[] monsters (cfgIds), int[] ranges, int angle
return 0;
}
@ -915,13 +976,13 @@ public class ScriptLib {
}
public int MovePlayerToPos(LuaTable var1){
logger.warn("[LUA] Call unimplemented MovePlayerToPos with {}", printTable(var1));
logger.warn("[LUA] Call unchecked MovePlayerToPos with {}", printTable(var1));
//TODO implement var1 contains int[] uid_list, Position pos, int radius, Position rot
return TransPlayerToPos(var1); // todo this is probably not a full scene reload
}
public int TransPlayerToPos(LuaTable var1){
logger.warn("[LUA] Call unimplemented TransPlayerToPos with {}", printTable(var1));
logger.warn("[LUA] Call unchecked TransPlayerToPos with {}", printTable(var1));
//TODO implement var1 contains int[] uid_list, Position pos, int radius, Position rot
var targetsTable = var1.get("uid_list");
var pos = var1.get("pos");
@ -948,7 +1009,12 @@ public class ScriptLib {
var scene = scriptManager.getScene();
scene.getPlayers().stream().filter(p -> targets.contains(p.getUid())).forEach(p -> {
scene.getWorld().transferPlayerToScene(p, scene.getId(), PlayerTeleportEvent.TeleportType.INTERNAL, targetPos);
scene.removePlayer(p);
scene.addPlayer(p);
p.getPosition().set(targetPos);
// Teleport packet
p.sendPacket(new PacketPlayerEnterSceneNotify(p, EnterTypeOuterClass.EnterType.ENTER_TYPE_GOTO, Lua, scene.getId(), targetPos));
});
return 0;
}
@ -985,9 +1051,12 @@ public class ScriptLib {
}
public int ActivateDungeonCheckPoint(int var1){
logger.warn("[LUA] Call unimplemented ActivateDungeonCheckPoint with {}", var1);
//TODO implement
return 0;
logger.warn("[LUA] Call untested ActivateDungeonCheckPoint with {}", var1);
var dungeonManager = getSceneScriptManager().getScene().getDungeonManager();
if(dungeonManager == null){
return 1;
}
return dungeonManager.activateRespawnPoint(var1) ? 0:2;
}
public int SetWeatherAreaState(int var1, int var2){
@ -1003,15 +1072,31 @@ public class ScriptLib {
return getSceneScriptManager().getScene().getWorld().isMultiplayer();
}
public int SetPlatformRouteId(int var2, int routeId){
logger.warn("[LUA] Call unimplemented SetPlatformRouteId {} {}", var2, routeId);
public int SetPlatformRouteId(int entityConfigId, int routeId){
logger.warn("[LUA] Call unimplemented SetPlatformRouteId {} {}", entityConfigId, routeId);
//TODO implement
// var2 == seelie ID?
// e.g. scene3_group133003381.lua action_EVENT_ENTER_REGION_381007 line 387
// or scene3_group133001159.lua action_EVENT_ENTER_REGION_159007 line 387
return 0;
}
public int CreateChannellerSlabCampRewardGadget(int configId){
logger.warn("[LUA] Call unimplemented CreateChannellerSlabCampRewardGadget {}", configId);
var group = currentGroup.getIfExists();
if(group == null){
return 1;
}
createGadget(configId, group);
//TODO implement fully
return 0;
}
public int AssignPlayerShowTemplateReminder(int var1, LuaTable var2){
logger.warn("[LUA] Call unimplemented AssignPlayerShowTemplateReminder {} {}", var1, var2);
//TODO implement var2 contains LuaTable param_uid_vec, LuaTable param_vec int[] uid_vec
return 0;
}
public int KillGroupEntity(LuaTable var1){
logger.debug("[LUA] Call KillGroupEntity with {}", printTable(var1));
//TODO check
@ -1044,10 +1129,10 @@ public class ScriptLib {
int[] targets = new int[monsterList.length()+gadgetList.length()];
int targetsIndex = 0;
for (int i = 1; i<monsterList.length(); i++, targetsIndex++){
for (int i = 1; i<=monsterList.length(); i++, targetsIndex++){
targets[targetsIndex] = monsterList.get(i).optint(-1);
}
for (int i = 1; i<gadgetList.length(); i++, targetsIndex++){
for (int i = 1; i<=gadgetList.length(); i++, targetsIndex++){
targets[targetsIndex] = gadgetList.get(i).optint(-1);
}
@ -1107,16 +1192,55 @@ public class ScriptLib {
var entity = getSceneScriptManager().getScene().getEntityByConfigId(configId);
return entity != null ? entity.getId() : 0;
}
public Position GetPosByEntityId(int entityId){
logger.warn("[LUA] Call GetPosByEntityId with {}", entityId);
public int GetAvatarEntityIdByUid(int uid){
logger.warn("[LUA] Call unchecked GetAvatarEntityIdByUid with {}", uid);
//TODO check
var entity = getSceneScriptManager().getScene().getEntityById(entityId);
return entity != null? entity.getPosition() : new Position();
var entity = getSceneScriptManager().getScene().getEntities().values().stream()
.filter(e -> e instanceof EntityAvatar && ((EntityAvatar)e).getPlayer().getUid() == uid)
.findFirst();
return entity.map(GameEntity::getId).orElse(0);
}
public Position GetRotationByEntityId(int entityId){
logger.debug("[LUA] Call GetRotationByEntityId with {}", entityId);
private LuaTable posToLua(Position position){
var result = new LuaTable();
if(position != null){
result.set("x", position.getX());
result.set("y", position.getY());
result.set("z", position.getZ());
} else {
result.set("x", 0);
result.set("y", 0);
result.set("z", 0);
}
return result;
}
public LuaTable GetPosByEntityId(int entityId){
logger.warn("[LUA] Call unchecked GetPosByEntityId with {}", entityId);
//TODO check
var entity = getSceneScriptManager().getScene().getEntityById(entityId);
return entity != null? entity.getRotation() : new Position();
return posToLua(entity != null? entity.getPosition() : null);
}
public LuaTable GetRotationByEntityId(int entityId){
logger.debug("[LUA] Call unchecked GetRotationByEntityId with {}", entityId);
//TODO check
var entity = getSceneScriptManager().getScene().getEntityById(entityId);
return posToLua(entity != null? entity.getRotation() : null);
}
public LuaTable GetActivityOpenAndCloseTimeByScheduleId(int scheduleId){
logger.debug("[LUA] Call GetActivityOpenAndCloseTimeByScheduleId with {}", scheduleId);
var result = new LuaTable();
var activityConfig = ActivityManager.getScheduleActivityConfigMap().get(scheduleId);
if(activityConfig != null){
result.set(1, LuaValue.valueOf(activityConfig.getBeginTime().getTime()));
result.set(2, LuaValue.valueOf(activityConfig.getEndTime().getTime()));
}
return result;
}
}

View File

@ -0,0 +1,7 @@
package emu.grasscutter.scripts.constants;
public enum SealBattleType {
NONE,
ENERGY_CHARGE,
KILL_MONSTER
}

View File

@ -6,6 +6,7 @@ public class ScriptArgs {
public int param3;
public int source_eid; // Source entity
public int target_eid;
public String source;
public ScriptArgs() {
}
@ -63,4 +64,13 @@ public class ScriptArgs {
this.target_eid = target_eid;
return this;
}
public String getEventSource() {
return source;
}
public ScriptArgs setEventSource(String source) {
this.source = source;
return this;
}
}

View File

@ -58,6 +58,10 @@ public final class PlayerTeleportEvent extends PlayerEvent implements Cancellabl
/**
* The player has asked to teleport using the command.
*/
COMMAND
COMMAND,
/**
* A script has asked the teleport.
*/
SCRIPT
}
}

View File

@ -91,7 +91,6 @@ public final class GameServer extends KcpServer {
this.init(GameSessionManager.getListener(),channelConfig,address);
DungeonChallenge.initialize();
EnergyManager.initialize();
StaminaManager.initialize();
CookingManager.initialize();

View File

@ -0,0 +1,26 @@
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.DungeonSlipRevivePointActivateReqOuterClass.DungeonSlipRevivePointActivateReq;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketDungeonSlipRevivePointActivateRsp;
@Opcodes(PacketOpcodes.DungeonSlipRevivePointActivateReq)
public class HandlerDungeonSlipRevivePointActivateReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
var req = DungeonSlipRevivePointActivateReq.parseFrom(payload);
var dungeonManager = session.getPlayer().getScene().getDungeonManager();
boolean success = false;
if (dungeonManager != null) {
success = dungeonManager.activateRespawnPoint(req.getSlipRevivePointId());
}
session.send(new PacketDungeonSlipRevivePointActivateRsp(success, req.getSlipRevivePointId()));
}
}

View File

@ -0,0 +1,26 @@
package emu.grasscutter.server.packet.recv;
import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.DungeonWayPointActivateReqOuterClass.DungeonWayPointActivateReq;
import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.packet.send.PacketDungeonWayPointActivateRsp;
@Opcodes(PacketOpcodes.DungeonWayPointActivateReq)
public class HandlerDungeonWayPointActivateReq extends PacketHandler {
@Override
public void handle(GameSession session, byte[] header, byte[] payload) throws Exception {
var req = DungeonWayPointActivateReq.parseFrom(payload);
var dungeonManager = session.getPlayer().getScene().getDungeonManager();
boolean success = false;
if(dungeonManager != null){
success = dungeonManager.activateRespawnPoint(req.getWayPointId());
}
session.send(new PacketDungeonWayPointActivateRsp(success, req.getWayPointId()));
}
}

View File

@ -1,63 +1,14 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.dungeons.challenge.WorldChallenge;
import emu.grasscutter.game.dungeons.dungeon_results.BaseDungeonResult;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.DungeonSettleNotifyOuterClass.DungeonSettleNotify;
import emu.grasscutter.net.proto.ItemParamOuterClass;
import emu.grasscutter.net.proto.TowerLevelEndNotifyOuterClass.TowerLevelEndNotify;
public class PacketDungeonSettleNotify extends BasePacket {
public PacketDungeonSettleNotify(WorldChallenge challenge) {
super(PacketOpcodes.DungeonSettleNotify);
DungeonSettleNotify proto = DungeonSettleNotify.newBuilder()
.setDungeonId(challenge.getScene().getDungeonData().getId())
.setIsSuccess(challenge.isSuccess())
.setCloseTime(challenge.getScene().getAutoCloseTime())
.setResult(challenge.isSuccess() ? 1 : 0)
.build();
this.setData(proto);
}
public PacketDungeonSettleNotify(WorldChallenge challenge,
boolean canJump,
boolean hasNextLevel,
int nextFloorId
public PacketDungeonSettleNotify(BaseDungeonResult result
) {
super(PacketOpcodes.DungeonSettleNotify);
var continueStatus = TowerLevelEndNotify.ContinueStateType.CONTINUE_STATE_TYPE_CAN_NOT_CONTINUE_VALUE;
if(challenge.isSuccess() && canJump){
continueStatus = hasNextLevel ? TowerLevelEndNotify.ContinueStateType.CONTINUE_STATE_TYPE_CAN_ENTER_NEXT_LEVEL_VALUE
: TowerLevelEndNotify.ContinueStateType.CONTINUE_STATE_TYPE_CAN_ENTER_NEXT_FLOOR_VALUE;
}
var towerLevelEndNotify = TowerLevelEndNotify.newBuilder()
.setIsSuccess(challenge.isSuccess())
.setContinueState(continueStatus)
.addFinishedStarCondList(1)
.addFinishedStarCondList(2)
.addFinishedStarCondList(3)
.addRewardItemList(ItemParamOuterClass.ItemParam.newBuilder()
.setItemId(201)
.setCount(1000)
.build())
;
if(nextFloorId > 0 && canJump){
towerLevelEndNotify.setNextFloorId(nextFloorId);
}
DungeonSettleNotify proto = DungeonSettleNotify.newBuilder()
.setDungeonId(challenge.getScene().getDungeonData().getId())
.setIsSuccess(challenge.isSuccess())
.setCloseTime(challenge.getScene().getAutoCloseTime())
.setResult(challenge.isSuccess() ? 1 : 0)
.setTowerLevelEndNotify(towerLevelEndNotify.build())
.build();
this.setData(proto);
this.setData(result.getProto());
}
}

View File

@ -0,0 +1,16 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.DungeonSlipRevivePointActivateRspOuterClass.DungeonSlipRevivePointActivateRsp;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketDungeonSlipRevivePointActivateRsp extends BasePacket {
public PacketDungeonSlipRevivePointActivateRsp(boolean success, int pointId) {
super(PacketOpcodes.DungeonSlipRevivePointActivateRsp);
this.setData(DungeonSlipRevivePointActivateRsp.newBuilder()
.setSlipRevivePointId(pointId)
.setRetcode(success ? RetcodeOuterClass.Retcode.RET_SUCC_VALUE : RetcodeOuterClass.Retcode.RET_FAIL_VALUE));
}
}

View File

@ -0,0 +1,16 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass;
import emu.grasscutter.net.proto.RetcodeOuterClass;
public class PacketDungeonWayPointActivateRsp extends BasePacket {
public PacketDungeonWayPointActivateRsp(boolean success, int pointId) {
super(PacketOpcodes.DungeonWayPointActivateRsp);
this.setData(DungeonWayPointActivateRspOuterClass.DungeonWayPointActivateRsp.newBuilder()
.setWayPointId(pointId)
.setRetcode(success ? RetcodeOuterClass.Retcode.RET_SUCC_VALUE : RetcodeOuterClass.Retcode.RET_FAIL_VALUE));
}
}

View File

@ -0,0 +1,19 @@
package emu.grasscutter.server.packet.send;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.DungeonWayPointActivateRspOuterClass;
import emu.grasscutter.net.proto.DungeonWayPointNotifyOuterClass;
import emu.grasscutter.net.proto.RetcodeOuterClass;
import java.util.Set;
public class PacketDungeonWayPointNotify extends BasePacket {
public PacketDungeonWayPointNotify(boolean added, Set<Integer> activePointIds) {
super(PacketOpcodes.DungeonWayPointNotify);
this.setData(DungeonWayPointNotifyOuterClass.DungeonWayPointNotify.newBuilder()
.addAllActiveWayPointList(activePointIds)
.setIsAdd(added));
}
}

View File

@ -39,11 +39,13 @@ public final class ServerTask implements Runnable {
* @return True if the task should run, false otherwise.
*/
public boolean shouldRun() {
// Increase tick count.
var ticks = this.ticks++;
if(this.delay != -1 && this.considerDelay) {
this.considerDelay = false;
return this.ticks == this.delay;
return ticks == this.delay;
} else if(this.period != -1)
return this.ticks % this.period == 0;
return ticks % this.period == 0;
else return true;
}
@ -52,7 +54,7 @@ public final class ServerTask implements Runnable {
* @return True if the task should be canceled, false otherwise.
*/
public boolean shouldCancel() {
return this.period == -1;
return this.period == -1 && ticks > delay;
}
/**
@ -61,7 +63,5 @@ public final class ServerTask implements Runnable {
@Override public void run() {
// Run the runnable.
this.runnable.run();
// Increase tick count.
this.ticks++;
}
}
}

View File

@ -94,6 +94,8 @@ public final class StartupArguments {
.setLevel(loggerLevel);
((Logger) LoggerFactory.getLogger("org.mongodb.driver"))
.setLevel(loggerLevel);
((Logger) LoggerFactory.getLogger("emu.grasscutter.scripts"))
.setLevel(loggerLevel);
return false;
}