Anime-Game-Servers / Grasscutter-Quests

A server software implementation, ineroperable with a certain anime game client. The code in this repository is fully custom made for edyoucational purposes and future preservation, no copyrighted code is allowed in this repository.
https://grasscutters.xyz/grasscutter
GNU Affero General Public License v3.0
137 stars 31 forks source link

[Bug] Li Dang is missing #107

Open scooterboo opened 9 months ago

scooterboo commented 9 months ago

Describe the bug In Moulder of Mountains - Talk to Li Dang (100805) Li Dang is missing

Notes:

This happens around the time he is supposed to appear:

23:22:49 <WARN:ScriptLibHandler> [LUA] Call RefreshGroup with {suite:5,group_id:133103907,}
23:22:49 <INFO:GameQuest> Quest 100805 has started
23:22:49 <INFO:GameQuest> Quest 100803 has finished
23:22:49 <INFO:GameQuest> Quest 100804 has finished

I think he's the npc seen in group 133103907. The different configs and suites are so that he can pop up in different places depending on which of those ambers you hit first.

npcs = {
    { config_id = 907001, npc_id = 10260, pos = { x = 734.414, y = 385.228, z = 1910.924 }, rot = { x = 0.000, y = 176.636, z = 0.000 }, area_id = 6 },
    { config_id = 907002, npc_id = 10260, pos = { x = 764.414, y = 313.120, z = 1769.485 }, rot = { x = 0.000, y = 221.234, z = 0.000 }, area_id = 6 },
    { config_id = 907003, npc_id = 10260, pos = { x = 759.329, y = 369.770, z = 1870.427 }, rot = { x = 0.000, y = 305.888, z = 0.000 }, area_id = 6 },
    { config_id = 907004, npc_id = 10260, pos = { x = 804.522, y = 329.158, z = 1828.241 }, rot = { x = 0.000, y = 287.437, z = 0.000 }, area_id = 6 },
    { config_id = 907005, npc_id = 10260, pos = { x = 746.885, y = 318.778, z = 1792.736 }, rot = { x = 0.000, y = 55.012, z = 0.000 }, area_id = 6 }
}

the thing is, I don't think RefreshGroup spawns npcs. When we look at SceneScriptManager.addGroupSuite, it only cares about gadgets and monsters:

    public void addGroupSuite(SceneGroupInstance groupInstance, SceneSuite suite, List<GameEntity> entities) {
        // we added trigger first
        registerTrigger(suite.getSceneTriggers());

        var group = groupInstance.getLuaGroup();
        var toCreate = new ArrayList<GameEntity>();
        toCreate.addAll(getGadgetsInGroupSuite(groupInstance, suite));
        toCreate.addAll(getMonstersInGroupSuite(groupInstance, suite));
        if(entities != null)
            toCreate.forEach(entities::add);
        else
            addEntities(toCreate);

        registerRegionInGroupSuite(group, suite);
    }

I hacked together my own getNPCsInGroupSuite, but didn't have luck. Maybe it didn't spawn due to low Vision level? not having any gadgets or monsters in 133103907 might make it so that the group never loads (no distance triggers it loading).

Which branch did you use? multi_proto Grasscutter version: 1.4.4-dev-4e8f709e Lua: JNLua

Screenshots image