Vendor with tokens, lua help ! menu

Shout-Out

User Tag List

Results 1 to 11 of 11
  1. #1
    Shalitas's Avatar Active Member CoreCoins Purchaser
    Reputation
    27
    Join Date
    Dec 2006
    Posts
    108
    Thanks G/R
    1/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Vendor with tokens, lua help !

    Hello guys, I am having problems with my donations vendors.
    Basicly, I want him to sell gear for tokens.
    100001 is my tokens
    99991 to 99995 are my items
    555555 is my npc (npcflags is set to 7 with is the vendor flag)


    The error is:


    and the lua script is:

    ERR_MSG = "You don't have enough tokens to buy this item.";


    function Event_Guide(unit, event, player, misc)
    unit:GossipCreateMenu(1, player, 0)
    unit:GossipMenuAddItem(0, "10 Donations Token Items", 4, 0)
    unit:GossipMenuAddItem(0, "20 Donations Token Items", 5, 0)
    unit:GossipSendMenu(player)
    end

    function Event_Submenu(unit, event, player, id, intid, code, misc)

    if(intid == 1) then
    unit:GossipCreateMenu(16, player, 0)
    unit:GossipMenuAddItem(0, "10 Donations Token Items", 4, 0)
    unit:GossipMenuAddItem(0, "20 Donations Token Items", 5, 0)
    unit:GossipSendMenu(player)
    end


    --10 token items
    if(intid == 4) then
    unit:GossipCreateMenu(21, player, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Dagger of Annihilation", 24, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Spectral glaive", 25, 0)
    unit:GossipMenuAddItem(0, "[Back]", 1, 0)
    unit:GossipSendMenu(player)
    end

    if(intid == 24) then
    if player:GetItemCount(100001) > 9 then
    player:RemoveItem(100001, 10)
    player:AddItem(99993, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    if(intid == 25) then
    if player:GetItemCount(100001) > 9 then
    player:RemoveItem(100001, 10)
    player:AddItem(99994, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    --20 token items
    if(intid == 5) then
    unit:GossipCreateMenu(21, player, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Hand of the Ancient", 29, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Staff of Destruction", 30, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Arcanite Fury", 31, 0)
    --unit:GossipMenuAddItem(0, "Item 6", 32, 0)
    --unit:GossipMenuAddItem(0, "Item 3", 33, 0)
    unit:GossipMenuAddItem(0, "[Back]", 1, 0)
    unit:GossipSendMenu(player)
    end

    if(intid == 29) then
    if player:GetItemCount(100001) > 19 then
    player:RemoveItem(100001, 20)
    player:AddItem(99991, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    if(intid == 30) then
    if player:GetItemCount(100001) > 19 then
    player:RemoveItem(100001, 20)
    player:AddItem(99992, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    if(intid == 31) then
    if player:GetItemCount(100001) > 19 then
    player:RemoveItem(100001, 20)
    player:AddItem(99995, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    end

    RegisterUnitGossipEvent(555555, 1, "Event_Guide")
    RegisterUnitGossipEvent(555555, 2, "Event_Subme
    Thanks alot for the supports !!!
    Btw, +3rep to the one who fix it !!!
    Follow me @ Twitch.tv/ShalitasWins

    Vendor with tokens, lua help !
  2. #2
    Algorithm's Avatar Member
    Reputation
    175
    Join Date
    Mar 2008
    Posts
    395
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    RegisterUnitGossipEvent(555555, 2, "Event_Subme
    did you forget something here?

  3. #3
    Shalitas's Avatar Active Member CoreCoins Purchaser
    Reputation
    27
    Join Date
    Dec 2006
    Posts
    108
    Thanks G/R
    1/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha... Really really stupid mistake lol but worth your +3rep
    it working now

    Thanks alot !
    Follow me @ Twitch.tv/ShalitasWins

  4. #4
    Algorithm's Avatar Member
    Reputation
    175
    Join Date
    Mar 2008
    Posts
    395
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your welcome

  5. #5
    Shalitas's Avatar Active Member CoreCoins Purchaser
    Reputation
    27
    Join Date
    Dec 2006
    Posts
    108
    Thanks G/R
    1/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mmm now im having an orther bug, I cant figure out what it is.
    My npc now show the menu ''10 donations token items''
    & ''10 donations token items'' but when we click on it, it wont open
    the items page :S any help? Will +rep again for help
    Follow me @ Twitch.tv/ShalitasWins

  6. #6
    Scubast3ve's Avatar Member
    Reputation
    55
    Join Date
    Apr 2009
    Posts
    125
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you please post the current script.
    Don't Forget To Give Rep To People Who Help You.

  7. #7
    Shalitas's Avatar Active Member CoreCoins Purchaser
    Reputation
    27
    Join Date
    Dec 2006
    Posts
    108
    Thanks G/R
    1/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here you go

    ERR_MSG = "You don't have enough tokens to buy this item.";


    function Event_Guide(unit, event, player, misc)
    unit:GossipCreateMenu(1, player, 0)
    unit:GossipMenuAddItem(0, "10 Donations Token Items", 4, 0)
    unit:GossipMenuAddItem(0, "20 Donations Token Items", 5, 0)
    unit:GossipSendMenu(player)
    end

    function Event_Submenu(unit, event, player, id, intid, code, misc)

    if(intid == 1) then
    unit:GossipCreateMenu(16, player, 0)
    unit:GossipMenuAddItem(0, "10 Donations Token Items", 4, 0)
    unit:GossipMenuAddItem(0, "20 Donations Token Items", 5, 0)
    unit:GossipSendMenu(player)
    end


    --10 token items
    if(intid == 4) then
    unit:GossipCreateMenu(21, player, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Dagger of Annihilation", 24, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Spectral glaive", 25, 0)
    unit:GossipMenuAddItem(0, "[Back]", 1, 0)
    unit:GossipSendMenu(player)
    end

    if(intid == 24) then
    if player:GetItemCount(100001) > 9 then
    player:RemoveItem(100001, 10)
    player:AddItem(99993, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    if(intid == 25) then
    if player:GetItemCount(100001) > 9 then
    player:RemoveItem(100001, 10)
    player:AddItem(99994, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    --20 token items
    if(intid == 5) then
    unit:GossipCreateMenu(21, player, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Hand of the Ancient", 29, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Staff of Destruction", 30, 0)
    unit:GossipMenuAddItem(0, "Gurubashi Arcanite Fury", 31, 0)
    --unit:GossipMenuAddItem(0, "Item 6", 32, 0)
    --unit:GossipMenuAddItem(0, "Item 3", 33, 0)
    unit:GossipMenuAddItem(0, "[Back]", 1, 0)
    unit:GossipSendMenu(player)
    end

    if(intid == 29) then
    if player:GetItemCount(100001) > 19 then
    player:RemoveItem(100001, 20)
    player:AddItem(99991, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    if(intid == 30) then
    if player:GetItemCount(100001) > 19 then
    player:RemoveItem(100001, 20)
    player:AddItem(99992, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    if(intid == 31) then
    if player:GetItemCount(100001) > 19 then
    player:RemoveItem(100001, 20)
    player:AddItem(99995, 1)
    player:GossipComplete()
    else
    player:SendChatMessage(12, 0, ERR_MSG)
    end
    end

    end

    RegisterUnitGossipEvent(555555, 1, "Event_Guide")
    RegisterUnitGossipEvent(555555, 2, "Event_Subme")
    Follow me @ Twitch.tv/ShalitasWins

  8. #8
    Bloodsin's Avatar Member
    Reputation
    13
    Join Date
    Jun 2007
    Posts
    165
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure the Item in the DB is set for currency if you talking about when you try to get the item it says Item not found.

  9. #9
    Shalitas's Avatar Active Member CoreCoins Purchaser
    Reputation
    27
    Join Date
    Dec 2006
    Posts
    108
    Thanks G/R
    1/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The item curency should be fine, it the brewfest token with a new name and a new entry id
    Follow me @ Twitch.tv/ShalitasWins

  10. #10
    Scubast3ve's Avatar Member
    Reputation
    55
    Join Date
    Apr 2009
    Posts
    125
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    missing something still?

    Code:
    RegisterUnitGossipEvent(555555, 2, "Event_Subme")
    should be

    Code:
    RegisterUnitGossipEvent(555555, 2, "Event_Submenu")
    you arent getting to the second section w/o it

    and you should use

    Code:
    player:SendAreaTriggerMessage(ERR_MSG)
    instead of

    Code:
    player:SendChatMessage(12, 0, ERR_MSG)
    Last edited by Scubast3ve; 04-25-2009 at 08:56 PM.
    Don't Forget To Give Rep To People Who Help You.

  11. #11
    Shalitas's Avatar Active Member CoreCoins Purchaser
    Reputation
    27
    Join Date
    Dec 2006
    Posts
    108
    Thanks G/R
    1/0
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Great thanks, it worked, +rep
    Follow me @ Twitch.tv/ShalitasWins

Similar Threads

  1. Replace GOLD with TOKENS on arcemu (help)
    By ello93 in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 01-02-2009, 08:55 AM
  2. Need help with Gossip Lua with Functions (3 rep to whoever fixes)
    By stoneharry in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 12-14-2008, 03:30 PM
  3. +Rep for Help with Universal Lua Teleporter
    By Lytle69 in forum WoW EMU Questions & Requests
    Replies: 16
    Last Post: 12-12-2008, 07:30 AM
  4. Help with this LUA script
    By jordash in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 03-08-2008, 04:19 PM
  5. [Help] i need Lua help with this script...
    By Ellenor in forum World of Warcraft Emulator Servers
    Replies: 25
    Last Post: 03-03-2008, 03:45 PM
All times are GMT -5. The time now is 02:17 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search