[IDEA] Configurable action/plugin interaction

Discussion in 'Archived: Plugin Requests' started by kovarex, Feb 14, 2011.

  1. Offline

    kovarex

    How to make the configurable plugin interaction?
    Before I make plugin allowing that, I would like to know if there isn't easier way.

    Situation:
    Lets say, you wanted to connect achievements plugin and plugin X, so that when you place 10k blocks, you are allowed to start using the X plugin
    Easy solution: Well you can just connect the achievements plugin with permisions and give the player the permission to use the plugin.

    Problem of easy solution: what if you don't want just to let the player to use X, but you (as server admin, not plugin maker) would like for example add 3 to skill jump when the user walks 10000 meters? You would have to connect the achievements plugin with the skill plugin and so on with every mod that needs to be connected to allow this.

    Better solution:
    All I need is plugin, that allows me to run command AS SOME PLAYER, for example
    from plugin
    runCommand(<player>, <command string>)
    like
    runCommand("admin","/<some skill plugin> add 3 to acrobatics to player XYZ");
    User admin would be the only one (probably) to have permissions to change skill attributes.

    When I have this I can make utility class that would get textual imput and convert it to action similar to achievements. and fire when needed

    Formats already in the achievements plugin:
    money <money to add or remove>
    item <item to give> <amount>
    Possible addition
    permission <permission name> state
    command <as player> <command>

    Achievements plugin would use this class so you could add in achievements this line
    <bla bla bla conditions 10k meters walked>:command admin add 3 to acrobatics to <player>

    (Player (and probably more info later) would have to be passed to the fire function of the utility as parameter so it can put it in the command, the string formatting would have to be specified.

    voila, as long as the plugin has permission support and good enough command control, I can connect achievements (or any other configurable plugin using this method), to any of those plugins.
     

Share This Page