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:
Nazrin
2023-08-07 15:03:13 -07:00
committed by GitHub
parent 8200607a15
commit b9a493d424
19 changed files with 119 additions and 67 deletions

View File

@@ -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!