Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 2 of 2
  1. #1
    Senior Sergeant
    MikExV™'s Avatar
    Join Date
    Feb 2010
    Location
    Ohio
    Posts
    117
    Post Thanks / Like
    Rep Power
    15
    Reputation
    35

    [Lua] Item Getter *Share*


    Register to remove this ad
    Code:
    local NPC_ID = 50033
    
    function NPC_OnGossipTalk(pUnit, event, player)
        pUnit:GossipCreateMenu(1, player, 1)
        pUnit:GossipMenuAddItem(1, "Claim a Item.", 1, 1)
        pUnit:GossipMenuAddItem(1, "Claim a Spell", 3, 0)
        pUnit:GossipMenuAddItem(1, "Nevermind.", 2, 0)
        pUnit:GossipSendMenu(player)
    end
    
    function NPC_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
        if(intid == 1) then
            if (player:GetGmRank() ==  'a') or (player:GetGmRank() ==  'az')  then
                local select = WorldDBQuery("SELECT * FROM items WHERE entry = "..code.."")
                local PlayerName = player:GetName()
                local AccountName = player:GetAccountName()
                local Rank = player:GetGmRank()
                if(select == NULL) then
                    player:SendBroadcastMessage("|cFFFF7401DF[NOTICE]:|r This doesn't exist!")
                    player:GossipComplete()
                    else
                    player:AddItem(code, 1)
                    player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You have recieved Item ID "..code.." and this transaction has been logged to the database.")
                    WorldDBQuery("INSERT INTO item_logs (`Entry`, `Character`, `Account`, `Rank`, `Item ID`, `Date`, `Time`) VALUES ('0', '"..PlayerName.."', '"..AccountName.."', '"..Rank.."', '"..code.."','"..os.date("%X").."', '"..os.date("%x").."');")
                    player:GossipComplete()
                end
            else
            player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You need to be a <GM> or <Admin> to use this Feature!")
            end
        end
        
        if(intid == 2) then
        player:GossipComplete()
        end
    end
    
       if(intid == 3) then
            if (player:GetGmRank() ==  'a') or (player:GetGmRank() ==  'az') or (player:GetGmRank() == 3) or (player:GetGmRank() == vip)  then
                local select = WorldDBQuery("SELECT * FROM items WHERE entry = "..code.."")
                local PlayerName = player:GetName()
                local AccountName = player:GetAccountName()
                local Rank = player:GetGmRank()
                if(select == NULL) then
                    player:SendBroadcastMessage("|cFFFF7401DF[NOTICE]:|r This doesn't exist!")
                    player:GossipComplete()
                    else
                    player:LearnSpell(code, 1)
                    player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You have recieved Item ID "..code.." and this transaction has been logged to the database.")
                    WorldDBQuery("INSERT INTO item_logs (`Entry`, `Character`, `Account`, `Rank`, `Item ID`, `Date`, `Time`) VALUES ('0', '"..PlayerName.."', '"..AccountName.."', '"..Rank.."', '"..code.."','"..os.date("%X").."', '"..os.date("%x").."');")
                    player:GossipComplete()
                end
            else
            player:SendBroadcastMessage("|cFFFF0000[NOTICE]:|r You need to be a <GM> or <Admin> to use this Feature!")
            end
    end
        
        if(intid == 2) then
        player:GossipComplete()
    end
    
    
    RegisterUnitGossipEvent(NPC_ID, 1, "NPC_OnGossipTalk")
    RegisterUnitGossipEvent(NPC_ID, 2, "NPC_OnGossipSelect")
    I take no credit for making this I just found it a wile back when i was running a server, and its helpful so I though I would post it. I do not know who made it.




    › See More: [Lua] Item Getter *Share*

    Just got my pc back



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Contributor
    Cocain's Avatar
    Join Date
    Mar 2010
    Posts
    208
    Post Thanks / Like
    Rep Power
    16
    Reputation
    92

    Register to remove this ad
    It's really nice, never seen an idea like this before.

 

 

Visitors found this page by searching for:

lua item getter

lua getter

lua item

lua getters

arcemu.org GetGmRank

SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 08:25 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org