[Release] Gambler NPC menu

Shout-Out

User Tag List

Page 1 of 3 123 LastLast
Results 1 to 15 of 32
  1. #1
    Mircast's Avatar Member
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Release] Gambler NPC

    Created by Mircast---
    ~~[[Credits: Sandile for the Idea]]


    -- Screen Shots --







    SQL
    Code:
    insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`) 
    values ('98231', "Bananas", "Gambler", '', '0', '1', '0', '0', '0', '0', '21362', '0', '0', '0', '1', '1', '0', '0');
    
    insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`) 
    values ('98231', '84', '84', '35', '1', '1', '0', '1', '1', '1900', '0', '100', '200', '0', '0', '0', '0', '3600000', '1', '0', '0', '0', '0', '0', '0', '0', '0', "0", '0', '0', '0', '0', '2.50', '8.00', '14.00', '0', '0', '0', '0', '0', '0', '0');






    LUA

    Code:
    function On_Gossip(unit, event, player)
    unit:RemoveEvents()
    if (player:IsInCombat() == true) then
    player:SendAreaTriggerMessage("Sorry, you have to leave combat first!")
    else  
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(5, "[Bet 1 Coin]", 1, 0)
    unit:GossipMenuAddItem(5, "[Bet 2 Coins]", 2, 0)
    unit:GossipMenuAddItem(5, "[Bet 5 Coins]", 3, 0)
    unit:GossipSendMenu(player)
    end
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    if (intid == 7) then
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(5, "[Bet 1 Coin]", 1, 0)
    unit:GossipMenuAddItem(5, "[Bet 2 Coins]", 2, 0)
    unit:GossipMenuAddItem(5, "[Bet 5 Coins]", 3, 0) 
    unit:GossipSendMenu(player)
    end
    
    if (intid == 3) then
    if (player:GetItemCount(ITEMID) < 5) then
    player:SendAreaTriggerMessage("You don't have enough coins to bet!")
    else
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(4, "Bet 5 Coins", 8, 0)
    unit:GossipMenuAddItem(4, "[BACK]", 7, 0)
    unit:GossipSendMenu(player)
    end
    end 
    
    if (intid == 8) then
    Choice=math.random(1, 4)
    if Choice==1 then
    player:SendAreaTriggerMessage("You won (5) Coins! You gambling whore!")
    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(ITEMID, 5)
    end
    if Choice==2 then
    player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
    player:RemoveItem(ITEMID, 5)
    end
    if Choice==3 then
    player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
    player:RemoveItem(ITEMID, 5)
    end
    if Choice==4 then
    player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
    player:RemoveItem(ITEMID, 5)
    end
    end
    
    if (intid == 1) then
    if (player:GetItemCount(ITEMID) < 1) then
    player:SendAreaTriggerMessage("You don't have enough coins to bet!")
    else
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(4, "Bet 1 Coin", 5, 0)
    unit:GossipMenuAddItem(4, "[BACK]", 7, 0)
    unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 5) then
    Choice=math.random(1, 2)
    if Choice==1 then
    player:SendAreaTriggerMessage("You won (1) Coin!")
    player:AddItem(ITEMID, 1)
    end
    if Choice==2 then
    player:SendAreaTriggerMessage("You lost (1) Coin, better luck next time!")
    player:RemoveItem(ITEMID, 1)
    end
    end
    
    if (intid == 2) then
    if (player:GetItemCount(ITEMID) < 2) then
    player:SendAreaTriggerMessage("You do not have enough coins to bet!")
    else
    unit:GossipCreateMenu(100, player, 0)
    unit:GossipMenuAddItem(4, "Bet 2 Coins", 6, 0)
    unit:GossipMenuAddItem(4, "[BACK]", 7, 0)
    unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 6) then
    Choice=math.random(1, 2)
    if Choice==1 then
    player:SendAreaTriggerMessage("You won (2) Coins!")
    player:AddItem(ITEMID, 2)
    end
    if Choice==2 then
    player:SendAreaTriggerMessage("You lost (2) Coins, better luck next time!")
    player:RemoveItem(ITEMID, 2)
    end
    end
    
    RegisterUnitGossipEvent(NPCID, 1, "On_Gossip")
    RegisterUnitGossipEvent(NPCID, 2, "Gossip_Submenus")
    :wave:

    [Release] Gambler NPC
  2. #2
    larzzon's Avatar Member
    Reputation
    6
    Join Date
    May 2008
    Posts
    70
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice Man, Shud be mroe ppl who reps! Gg Josh

  3. #3
    y2kss66's Avatar Member
    Reputation
    104
    Join Date
    Jan 2008
    Posts
    778
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice script I remember seeing this earlier. good to see it finished!
    +RepX2

  4. #4
    lopedawg99's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    39
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you +rep

  5. #5
    Mircast's Avatar Member
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, they finally approved it, took about a week but I'm happy now. =P

  6. #6
    larzzon's Avatar Member
    Reputation
    6
    Join Date
    May 2008
    Posts
    70
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    :)

    GG Mircast, nice work,will use this

  7. #7
    Mircast's Avatar Member
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    116 views, 5 replies. ;(
    Last edited by Mircast; 03-26-2009 at 04:28 PM.

  8. #8
    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)
    Rather simple tohugh it gets the job done. The math.random is not entirely random. if you take a math.random(1,4) then the chance is bigger that it 'randomly' picks 1. This is what I have tested with personal experience, it's about a 80% chance that it will pick 1.

  9. #9
    Sandile's Avatar Member
    Reputation
    32
    Join Date
    Aug 2008
    Posts
    314
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice work Josh. +Rep (when I can :P)
    "i downloaded it in "pirates bay", can you tell me how to download it in steam, pls"

  10. #10
    [Shon3m]'s Avatar Banned
    Reputation
    128
    Join Date
    Apr 2007
    Posts
    669
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haha nice work man +rep

  11. #11
    mako1's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice, looks cool

  12. #12
    Mircast's Avatar Member
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Claiver View Post
    Rather simple tohugh it gets the job done. The math.random is not entirely random. if you take a math.random(1,4) then the chance is bigger that it 'randomly' picks 1. This is what I have tested with personal experience, it's about a 80% chance that it will pick 1.
    Code:
    if (intid == 8) then
    Choice=math.random(1, 4)
    if Choice==1 then
    player:SendAreaTriggerMessage("You won (5) Coins! You gambling whore!")
    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(ITEMID, 5)
    end
    if Choice==2 then
    player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
    player:RemoveItem(ITEMID, 5)
    end
    if Choice==3 then
    player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
    player:RemoveItem(ITEMID, 5)
    end
    if Choice==4 then
    player:SendAreaTriggerMessage("You lost (5) Coins, better luck next time!")
    player:RemoveItem(ITEMID, 5)
    end
    end
    I've tested the script and out of 10 gambles, I lost 8 times.

  13. #13
    Mircast's Avatar Member
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Soularis View Post
    haha nice work man +rep

    Thanks alot!
    btw typing +rep will not give reputation, you must click the +Rep button on my first post.

  14. #14
    Mircast's Avatar Member
    Reputation
    14
    Join Date
    Sep 2008
    Posts
    139
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Sandile View Post
    Nice work Josh. +Rep (when I can :P)
    Thank-you. :/

  15. #15
    saperior's Avatar Active Member
    Reputation
    58
    Join Date
    Feb 2008
    Posts
    136
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice work Josh! Will use this for my server.

    +rep x2

Page 1 of 3 123 LastLast

Similar Threads

  1. [Release] Twink Npc
    By Sylex in forum World of Warcraft Emulator Servers
    Replies: 22
    Last Post: 02-24-2008, 03:51 AM
  2. [Release] ALL Npc Display IDs!
    By Hellgawd in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 02-01-2008, 12:47 PM
  3. [Release] Wareagles NPCS and Chest Query
    By Hellgawd in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 01-21-2008, 05:46 PM
  4. [Release] Helper Npcs
    By wowcomputer in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 12-25-2007, 05:42 AM
  5. [RELEASE] Morph NPC
    By pepsi1x1 in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 12-04-2007, 08:42 PM
All times are GMT -5. The time now is 08:11 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