[Lua] Gamble NPC :D menu

Shout-Out

User Tag List

Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    grey69's Avatar Member
    Reputation
    31
    Join Date
    Aug 2008
    Posts
    62
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice script, i created the coins which are sold 10g each, cool stuff +rep

    time to go broke

    [Lua] Gamble NPC :D
  2. #17
    Tikki100's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2008
    Posts
    83
    Thanks G/R
    3/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For one time, im helping people instead of just geeking wow xD

  3. #18
    saintchuck's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey this is beast and i REALLY REALLY want it but i am the biggest n00b you will ever hear of so how do i put this in DB?? do i execute it like an sql??

  4. #19
    grey69's Avatar Member
    Reputation
    31
    Join Date
    Aug 2008
    Posts
    62
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My edits, it might help someone. The player cannot lose all coins with this, he will end up with 1 coin if he ever has very bad luck so yeah it's a money making machine

    LUA
    Code:
    function Gambler_On_Gossip(unit, event, player)
    if (player:IsPlayer() == true) then
    unit:GossipCreateMenu(1, player, 0)
    unit:GossipMenuAddItem(0, "I will gamble 5 Coins (25% chance) and Win 25 coins!", 1, 0)
    unit:GossipSendMenu(player)
    else
    unit:GossipCreateMenu(1, player, 0)
    unit:GossipSendMenu(player)
    end
    end
    
    function Gambler_Gossip_Submenus(unit, event, player, id, intid, code)
    
    if (intid == 1) then
    if (player:GetItemCount(80010) < 1) then --Remember to set the item id!
    player:SendAreaTriggerMessage("You don't have enough Coins to bet!")
    player:GossipComplete()
    else
    Choice=math.random(1, 100)
    if Choice >= 1 and Choice <= 25 then -- Change 20 to another procent. Currently the chance for u win is 25%
    player:SendAreaTriggerMessage("You won 25 Coins! Lucky you >.<")
    unit:FullCastSpellOnTarget(33082, player)
    unit:FullCastSpellOnTarget(33081, player)
    unit:FullCastSpellOnTarget(33077, player)
    unit:FullCastSpellOnTarget(33078, player)
    unit:FullCastSpellOnTarget(33079, player)
    unit:FullCastSpellOnTarget(33080, player)
    player:AddItem(80010, 25) -- REMEMBER TO SET ITEMID and 50 u win 50 coins. Be free to change it
    player:GossipComplete()
    else
    player:SendAreaTriggerMessage("You lost 5 coins, and that means more money to me ")
    player:RemoveItem(80010, 5)
    player:GossipComplete()
    end
    end
    
    if (intid == 2) then -- Ignore this <.> to fix the you can only have 1 gossip submenu bug :P
    player:SendAreaTriggerMessage("")
    player:GossipComplete()
    end
    end
    end
    
    
    RegisterUnitGossipEvent(60000, 1, "Gambler_On_Gossip") -- Remember the npc id!
    RegisterUnitGossipEvent(60000, 2, "Gambler_Gossip_Submenus")
    SQL NPC
    Code:
    INSERT INTO `creature_names` VALUES ('60000', 'Gamble NPC', 'Wanna bet?', '', '0', '0', '0', '1', '0', null, '18154', '0', '0', '0', '1', '1', '0', null);
    
    INSERT INTO `creature_proto` VALUES ('60000', '80', '80', '35', '100000', '100000', '100', '0.5', '177', '1500', '-1', '0', '0', '0', '0', '0', '0', '36000', '10000', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '2.5', '8', '14', '0', '0', '0', '0', '0', '0', '0');
    SQL reward coin
    Code:
    INSERT INTO `items` VALUES ('80010', '15', '0', '-1', 'Gold Gamble Coin', '', '', '', '58679', '3', '0', '100000', '100000', '0', '-1', '-1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '200', '0', '10', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1500', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', 'Exchange me at Gamble NPC!', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', null, '0', null, '0', '0', '0', '0', '0', '0', '0', null, '-1', '0', '0', '0');
    Just add the item 80010 to any vendor, which is sold 10g then you're setup.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. [Guide] LUA teleporter NPC template and guide!!
    By Jackie Moon in forum WoW EMU Guides & Tutorials
    Replies: 34
    Last Post: 04-07-2009, 03:36 PM
  2. [Template] LUA Teleporter NPC and Mini guide!!
    By Jackie Moon in forum WoW EMU General Releases
    Replies: 13
    Last Post: 03-15-2009, 04:07 PM
  3. [LUA]Music NPC
    By Edude in forum WoW EMU General Releases
    Replies: 19
    Last Post: 11-08-2008, 06:59 AM
  4. Lua Warp Npc , but it wont load -.-
    By mafiaboy in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 06-28-2008, 02:58 AM
  5. LUA Tele NPC.
    By Ickybad in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 06-08-2008, 06:08 AM
All times are GMT -5. The time now is 05:00 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