Commit 04f0fae8 authored by GanyusLeftHorn's avatar GanyusLeftHorn Committed by GitHub
Browse files

Handle Unlocking of Waypoints and Statues (#1608)

Original commits:

* Add necessary protos for scene point/area unlocking.

* Rename PlayerOpenStateManager to PlayerProgressManager and move data to Player.

* Handle unlocking of waypoints.

* Add primo rewards for waypoint unlock.

* Statue unlocking.

* Add statue quest on player login.

* I forgor to add an unlock command.

* Give EXP as reward, fire quest trigger, make EXP UI show up.
parent 2d48fab7
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.player.Player;
import emu.grasscutter.game.props.PlayerProperty;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.PlayerPropChangeReasonNotifyOuterClass.PlayerPropChangeReasonNotify;
import emu.grasscutter.net.proto.PropChangeReasonOuterClass.PropChangeReason;
public class PacketPlayerPropChangeReasonNotify extends BasePacket {
public PacketPlayerPropChangeReasonNotify(Player player, PlayerProperty prop, int oldValue, int newValue, PropChangeReason changeReason) {
super(PacketOpcodes.PlayerPropChangeReasonNotify);
this.buildHeader(0);
PlayerPropChangeReasonNotify proto = PlayerPropChangeReasonNotify.newBuilder()
.setPropType(prop.getId())
.setReason(changeReason)
.setOldValue(oldValue)
.setCurValue(newValue)
.build();
this.setData(proto);
}
}
package emu.grasscutter.server.packet.send;
import java.util.List;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.SceneAreaUnlockNotifyOuterClass.SceneAreaUnlockNotify;
public class PacketSceneAreaUnlockNotify extends BasePacket {
public PacketSceneAreaUnlockNotify(int sceneId, int areaId) {
super(PacketOpcodes.SceneAreaUnlockNotify);
SceneAreaUnlockNotify.Builder p = SceneAreaUnlockNotify.newBuilder()
.setSceneId(sceneId)
.addAreaList(areaId);
this.setData(p);
}
public PacketSceneAreaUnlockNotify(int sceneId, List<Integer> areaIds) {
super(PacketOpcodes.SceneAreaUnlockNotify);
SceneAreaUnlockNotify.Builder p = SceneAreaUnlockNotify.newBuilder()
.setSceneId(sceneId)
.addAllAreaList(areaIds);
this.setData(p);
}
}
package emu.grasscutter.server.packet.send;
import java.util.List;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.ScenePointUnlockNotifyOuterClass.ScenePointUnlockNotify;
public class PacketScenePointUnlockNotify extends BasePacket {
public PacketScenePointUnlockNotify(int sceneId, int pointId) {
super(PacketOpcodes.ScenePointUnlockNotify);
ScenePointUnlockNotify.Builder p = ScenePointUnlockNotify.newBuilder()
.setSceneId(sceneId)
.addPointList(pointId);
this.setData(p);
}
public PacketScenePointUnlockNotify(int sceneId, List<Integer> pointIds) {
super(PacketOpcodes.ScenePointUnlockNotify);
ScenePointUnlockNotify.Builder p = ScenePointUnlockNotify.newBuilder()
.setSceneId(sceneId)
.addAllPointList(pointIds);
this.setData(p);
}
}
package emu.grasscutter.server.packet.send;
import emu.grasscutter.game.avatar.Avatar;
import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.RetcodeOuterClass.Retcode;
import emu.grasscutter.net.proto.UnlockTransPointRspOuterClass.UnlockTransPointRsp;
public class PacketUnlockTransPointRsp extends BasePacket {
public PacketUnlockTransPointRsp(Retcode retcode) {
super(PacketOpcodes.UnlockTransPointRsp);
UnlockTransPointRsp proto = UnlockTransPointRsp.newBuilder()
.setRetcode(retcode.getNumber())
.build();
this.setData(proto);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment