mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-14 07:55:57 +01:00
fix quest content and condition triggers (#2283)
* Add param3 to EVENT_GADGET_STATE_CHANGE * Slight cleanup for DungeonManager * Fix ContentTriggerFire * Rework and fix talk content and conditions. * redo item content and conditions, swap out getItemByGuid with getItemById, and make count handling consistent. * Don't need to check if checkItem is null * add this. to DungeonManager.java * add this to Inventory.java * Update src/main/java/emu/grasscutter/game/quest/QuestManager.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> * add spaces to ContentCompleteAnyTalk.java * Update src/main/java/emu/grasscutter/game/quest/content/ContentCompleteAnyTalk.java Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com> --------- Co-authored-by: Magix <27646710+KingRainbow44@users.noreply.github.com>
This commit is contained in:
@@ -150,6 +150,7 @@ public class EntityGadget extends EntityBaseGadget {
|
||||
public void updateState(int state) {
|
||||
if (state == this.getState()) return; // Don't triggers events
|
||||
|
||||
var oldState = this.getState();
|
||||
this.setState(state);
|
||||
ticksSinceChange = getScene().getSceneTimeSeconds();
|
||||
this.getScene().broadcastPacket(new PacketGadgetStateNotify(this, state));
|
||||
@@ -157,7 +158,7 @@ public class EntityGadget extends EntityBaseGadget {
|
||||
.getScriptManager()
|
||||
.callEvent(
|
||||
new ScriptArgs(
|
||||
this.getGroupId(), EventType.EVENT_GADGET_STATE_CHANGE, state, this.getConfigId()));
|
||||
this.getGroupId(), EventType.EVENT_GADGET_STATE_CHANGE, state, this.getConfigId()).setParam3(oldState));
|
||||
}
|
||||
|
||||
@Deprecated(forRemoval = true) // Dont use!
|
||||
|
||||
Reference in New Issue
Block a user