It does not work at all, but the problem is with Coca not being recognized as a resource which can have a monopoly, not necessarily with the lua (though the lua might not work either, we don't know yet).The lua is set to trigger if the boolean value for (1 - "has monopoly"/0 - "doesn't have monopoly"). The lua could simply calculate whether or not a monopoly exists itself: if(2*GetNumResourcesOwned(RES_COCA)=>GetNumResource(RES_COCA), but I thought it would be better if the lua worked using the existing sql.
Coca "bug" is not a bug, you are just not using game features correctly. Monopoly is calculated ONLY for resources on the map. You won't get a monopoly from granted resources. See the picture - I've added two resources to the map and all works as intended. Granted resources can only increase your percentage. If you don't want coca to spawn on the map, then you must abandon monopoly bonus, there's no way around it.
Attachments
Last edited: