[Lua] Gamble NPC :D menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    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)

    [Lua] Gamble NPC :D

    Well here is my first release, by a little help of my friend Nightfoxx change everything in red :P

    Lua Engine used: None

    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 (Win 50 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(ITEMIDITEMIDITEMID) < 5) 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 <= 20 then -- Change 20 to another procent. Currently the chance for u win is 20%
    player:SendAreaTriggerMessage("You won 50 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(ITEMIDITEMIDITEMID, 50) -- 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(ITEMIDITEMIDITEMID, 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(NPCID, 1, "Gambler_On_Gossip") -- Remember the npc id!
    RegisterUnitGossipEvent(NPCID, 2, "Gambler_Gossip_Submenus")
    Lua Engine used: Gastricpenguin
    Someone test this pl0x ^^

    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 (Win 50 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:CanRemoveGold(5)) then
    player:SendAreaTriggerMessage("You don't have enough Coins to bet!")
    player:GossipComplete()
    else
    Choice=math.random(1, 100)
    if Choice >= 1 and Choice <= 20 then -- Change 20 to another procent. Currently the chance for u win is 20%
    player:SendAreaTriggerMessage("You won 50 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:AddCoinage(50, 0, 0) -- U win 50 gold coins 50 is gold, then there is silver then copper. Be FREE to change :P
    player:GossipComplete()
    else
    player:SendAreaTriggerMessage("You lost 5 coins, and that means more money to me ")
    player:RemoveGold(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(NPCID, 1, "Gambler_On_Gossip") -- Remember the npc id!
    RegisterUnitGossipEvent(NPCID, 2, "Gambler_Gossip_Submenus")
    Hope you like!
    Last edited by Tikki100; 06-30-2009 at 07:02 PM.

    [Lua] Gamble NPC :D
  2. #2
    sasoritail's Avatar Contributor
    Reputation
    161
    Join Date
    Sep 2008
    Posts
    655
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I like it
    +Rep
    It's been a while

  3. #3
    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)
    xD Yea i was in need of some rep :P

  4. #4
    colincancer's Avatar Active Member
    Reputation
    63
    Join Date
    Dec 2007
    Posts
    509
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very nice my friend, but might I be so bold to ask... what am I putting in for ITEMID if your betting gold?

    EDIT: NVM it's for an item to be sold for gold...my bad.
    #JODYS'WATCHiN

  5. #5
    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)
    Nightfoxx -.- Needs a Gua engine for that. Well i can try look on it, making an Exstra script ^^

  6. #6
    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)
    xD I just love you mr. newb

  7. #7
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey man looks neat (+Rep if I can), but you could have made it even easier by defining variables on top and use that in your script ! non the less, thank you .

  8. #8
    BadLT06's Avatar Member
    Reputation
    5
    Join Date
    Jan 2008
    Posts
    23
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    great script, even though it DOES encourage gambling. At least it isn't real money.

  9. #9
    I Hypnotoad I's Avatar Contributor
    Reputation
    147
    Join Date
    Aug 2007
    Posts
    873
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Save The Children! xD

    +, to my favorite gender confused Night elf. :3


    Dragon[Sky] can get into our signatures, AND our pants.



  10. #10
    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)
    Well claiver, im yet not so good at variables But i will be looking on it ;P

  11. #11
    hosterr's Avatar Member
    Reputation
    0
    Join Date
    Aug 2008
    Posts
    16
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice +rep

  12. #12
    Heliumz's Avatar Member
    Reputation
    26
    Join Date
    Jun 2009
    Posts
    113
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha this npc should be spawn in place for 18+ players only :P

    we need to make an casino instance that check birthday of the account.. then if 18+ can enter if not can't :P

    +Rep!

  13. #13
    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)
    XD nice yeah :P

  14. #14
    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)
    No reply's

  15. #15
    I Hypnotoad I's Avatar Contributor
    Reputation
    147
    Join Date
    Aug 2007
    Posts
    873
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *Replies*

    (Fillerdadillerdadillerdadiller)
    .


    Dragon[Sky] can get into our signatures, AND our pants.



Page 1 of 2 12 LastLast

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:55 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search