luaazerothcoreeluna-lua-engine

ElunaLuaEngine need help wi-th script


I would like to create a script using the Eluna Lua Engine that implements the following:

If a player has an item 192021 in his inventory, then he will be able to talk to npc 202020 and take quest 36004. And if a player doesn't have an item 192021, then there is no dialogue.


Solution

  • I think it's better to do in SQL instead of LUA

    It is possible to do it with the table conditions

        SET
            @QUESTID := ,
            @ITEMID := ,
            @ITEMCOUNT := ,
            @COMMENT := 'My Super Condition!';
        INSERT INTO `conditions` (SourceTypeOrReferenceId, SourceGroup, SourceEntry, SourceId, ElseGroup, ConditionTypeOrReference, ConditionValue1, ConditionValue2)
            VALUES
            (19, 0, @QUESTID, 0, 0, 2, @ITEMID, @ITEMCOUNT, @COMMENT);