Lottery Lua Unique menu

User Tag List

Results 1 to 13 of 13
  1. #1
    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)

    Lottery Lua Unique

    Code:
    function On_Gossip(unit, event, player)
    local NPCID = 198768
    local ITEMID = 32569
    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: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:GossipSendMenu(player)
    end
    
    if (intid == 1) then
    if (player:GetItemCount(ITEMID) < 1) then
    player:SendAreaTriggerMessage("You don't have enough coins to bet!")
    else
    unit:GossipMenuAddItem(5, "You have a 50% chance of winning, continue?", 80, 0)
    unit:GossipMenuAddItem(4, "Yes, I'll do it", 5, 0)
    unit:GossipMenuAddItem(4, "No, I'd rather not", 7, 0)
    unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 5) then
    Choice=math.random(1, 2)
    if Choice==1 then
    player:AddItem(ITEMID, 1)
    end
    if Choice==2 then
    player:RemoveItem(ITEMID, 1)
    end
    end
    
    if (intid == 80) then
    unit:GossipComplete(player)
    end
    end
    
    if (intid == 2) then
    if (player:GetItemCount(ITEMID) < 2) then
    player:SendAreaTriggerMessage("You do not have enough coins to bet!")
    else
    unit:GossipMenuAddItem(5, "You have a 50% chance of winning, continue?", 80, 0)
    unit:GossipMenuAddItem(4, "Yes, make haste", 6, 0)
    unit:GossipMenuAddItem(4, "No, take me back", 7, 0)
    unit:GossipSendMenu(player)
    end
    end
    
    if (intid == 6) then
    Choice=math.random(1, 2)
    if Choice==1 then
    player:AddItem(ITEMID, 2)
    end
    if Choice==2 then
    player:RemoveItem(ITEMID, 2)
    end
    end
    
    RegisterUnitGossipEvent(NPCID, 1, "On_Gossip")
    RegisterUnitGossipEvent(NPCID, 2, "Gossip_Submenus")
    UPDATED

    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
       (198768, 'Lizzrik Styliz', 'The Lottery Goblin', 0, 0, 7, 0, 1, 0, 0, 191881, 0, 0, 0, 1, 1, NULL, 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
       (198768, 80, 80, 1555, 1000, 1000, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, '', 0, 0, 0, 0, 2.5, 8, 14, 0, 0, 0, 0, 0, 0, 0);
    The script is easy to understand and its very easy to modify if you wish to.

    Credits go to josh253 for making most of the script and to me for the whole idea the SQL and some small modifications to the script.
    Last edited by Sandile; 03-15-2009 at 08:39 AM.
    "i downloaded it in "pirates bay", can you tell me how to download it in steam, pls"

    Lottery Lua Unique
  2. #2
    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)
    I made the script based on your idea ^^

    Post some screenshots :wave:

  3. #3
    sekto's Avatar Member
    Reputation
    1
    Join Date
    Feb 2009
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your creature name and creature proto entry ids dont match
    198768 for creature name
    198767 for creature proto

    And the bet 2 coins doesnt work

    Aside from that, nice script!
    Also, how can u make it so doesnt always say "you receive loot" .. it says that even when u lose and one is taken away..

    Here's an SS of the script in action
    Last edited by sekto; 03-14-2009 at 01:35 PM.

  4. #4
    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 sekto View Post
    your creature name and creature proto entry ids dont match
    198768 for creature name
    198767 for creature proto

    And the bet 2 coins doesnt work

    Aside from that, nice script!
    Also, how can u make it so doesnt always say "you receive loot" .. it says that even when u lose and one is taken away..

    Here's an SS of the script in action

    Well Sandile made the SQL and released it, but thanks for the screenie.
    Not to sure on the You recieve when it's taken away. D:
    But when it does get taken away I could make a message like "You lost 1 token!"

  5. #5
    XatoA's Avatar Active Member
    Reputation
    25
    Join Date
    Nov 2007
    Posts
    128
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Good job, just need a few things fixed like when it gets taken from yur bags it says that not that yu recieve loot, but +2 rep

  6. #6
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    150/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Looks good, but try using a few variables instead of having to fill in each npcid and itemid etc. For example "local NPCID = 40873" then every NPCID will mean 40873. +Rep

  7. #7
    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)
    Ok, I made some improvements now.
    Im working on why "bet 2 coins" doesn't work.
    Last edited by Sandile; 03-15-2009 at 07:22 AM.
    "i downloaded it in "pirates bay", can you tell me how to download it in steam, pls"

  8. #8
    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 stoneharry View Post
    Looks good, but try using a few variables instead of having to fill in each npcid and itemid etc. For example "local NPCID = 40873" then every NPCID will mean 40873. +Rep
    Go into notepad, click Edit, then go to replace.
    You can replace ITEMID with your actual item id, it will go through all of them and replace it. =)

    [NOTE] I've released a NEW version of this, with everything fixed + screenshots
    just waiting to get it approved by a moderator

  9. #9
    senkin's Avatar Member
    Reputation
    21
    Join Date
    Sep 2008
    Posts
    38
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I really love the novel idea, but the code was all messed up. (No Offense)
    Here is a fixed up version I made for you an everyone else.

    LUA File (create a .lua file, put the code below, change ITEMID number to a one you want for the coin to be, save, then put it in your scripts folder)
    Code:
    local NPCID = 198767
    local ITEMID = 32569
    
    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:GossipSendMenu(player)
    	end
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    	if (intid == 1) then
    		unit:GossipCreateMenu(100, player, 0)
    		unit:GossipMenuAddItem(4, "Yes, I understand I have a 25% chance of winning.", 3, 0)
    		unit:GossipMenuAddItem(4, "I changed my mind, I want to go back to the main menu.", 5, 0)
    		unit:GossipSendMenu(player)
    	end
    
    	if (intid == 2) then
    		unit:GossipCreateMenu(100, player, 0)
    		unit:GossipMenuAddItem(4, "Yes, I understand I have a 50% chance of winning.", 4, 0)
    		unit:GossipMenuAddItem(4, "I changed my mind, I want to go back to the main menu.", 5, 0)
    		unit:GossipSendMenu(player)
    	end
    	
    	if (intid == 3) then
    		Choice=math.random(1,4)
    		if Choice==1 then
    			player:GossipComplete(player)
    			unit:SendChatMessage(12, 0, "You win!")
    			player:AddItem(ITEMID, 1)
    		else
    			player:GossipComplete(player)
    			unit:SendChatMessage(12, 0, "You lose")
    			player:RemoveItem(ITEMID,1)
    		end
    	end
    
    	if (intid == 4) then
    		Choice=math.random(1,2)
    		if Choice==1 then
    			player:GossipComplete(player)
    			unit:SendChatMessage(12, 0, "You win!")
    			player:AddItem(ITEMID, 1)
    		else
    			player:GossipComplete(player)
    			unit:SendChatMessage(12, 0, "You lose")
    			player:RemoveItem(ITEMID,1)
    		end
    	end
    	
    	if (intid == 5) then
    		unit:GossipCreateMenu(100, player, 0)
    		unit:GossipMenuAddItem(5, "Bet 1 Coin", 1, 0)
    		unit:GossipMenuAddItem(5, "Bet 2 Coins", 2, 0)
    		unit:GossipSendMenu(player)
    	end
    
    end
    
    RegisterUnitGossipEvent(NPCID, 1, "On_Gossip")
    RegisterUnitGossipEvent(NPCID, 2, "Gossip_Submenus")
    SQL File (create a .sql file with this code in it, save, then import it to your world database)
    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 (198767, 'Lizzrik Styliz', 'The Lottery Goblin', 0, 0, 7, 0, 1, 0, 0, 21640, 0, 0, 0, 1, 1, NULL, 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 (198767, 80, 80, 1555, 1000, 1000, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, '', 0, 0, 0, 0, 2.5, 8, 14, 0, 0, 0, 0, 0, 0, 0);
    Screen Shots


    I hope you take the time to read the code carefully so you can learn off of it. Once again thank you for the novel idea and the original code. I hope I did not offend you.

    +Rep to you.
    Last edited by senkin; 03-15-2009 at 09:14 AM.

  10. #10
    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)
    I've already released a fixed version, I stated this is my last post. :/

  11. #11
    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)
    Originally Posted by senkin View Post
    I really love the novel idea, but the code was all messed up. (No Offense)
    Here is a fixed up version I made for you an everyone else.

    LUA File (create a .lua file, put the code below, change ITEMID number to a one you want for the coin to be, save, then put it in your scripts folder)
    Code:
    local NPCID = 198767
    local ITEMID = 32569
    
    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:GossipSendMenu(player)
    	end
    end
    
    function Gossip_Submenus(unit, event, player, id, intid, code)
    
    	if (intid == 1) then
    		unit:GossipCreateMenu(100, player, 0)
    		unit:GossipMenuAddItem(4, "Yes, I understand I have a 25% chance of winning.", 3, 0)
    		unit:GossipMenuAddItem(4, "I changed my mind, I want to go back to the main menu.", 5, 0)
    		unit:GossipSendMenu(player)
    	end
    
    	if (intid == 2) then
    		unit:GossipCreateMenu(100, player, 0)
    		unit:GossipMenuAddItem(4, "Yes, I understand I have a 50% chance of winning.", 4, 0)
    		unit:GossipMenuAddItem(4, "I changed my mind, I want to go back to the main menu.", 5, 0)
    		unit:GossipSendMenu(player)
    	end
    	
    	if (intid == 3) then
    		Choice=math.random(1,4)
    		if Choice==1 then
    			player:GossipComplete(player)
    			unit:SendChatMessage(12, 0, "You win!")
    			player:AddItem(ITEMID, 1)
    		else
    			player:GossipComplete(player)
    			unit:SendChatMessage(12, 0, "You lose")
    			player:RemoveItem(ITEMID,1)
    		end
    	end
    
    	if (intid == 4) then
    		Choice=math.random(1,2)
    		if Choice==1 then
    			player:GossipComplete(player)
    			unit:SendChatMessage(12, 0, "You win!")
    			player:AddItem(ITEMID, 1)
    		else
    			player:GossipComplete(player)
    			unit:SendChatMessage(12, 0, "You lose")
    			player:RemoveItem(ITEMID,1)
    		end
    	end
    	
    	if (intid == 5) then
    		unit:GossipCreateMenu(100, player, 0)
    		unit:GossipMenuAddItem(5, "Bet 1 Coin", 1, 0)
    		unit:GossipMenuAddItem(5, "Bet 2 Coins", 2, 0)
    		unit:GossipSendMenu(player)
    	end
    
    end
    
    RegisterUnitGossipEvent(NPCID, 1, "On_Gossip")
    RegisterUnitGossipEvent(NPCID, 2, "Gossip_Submenus")
    SQL File (create a .sql file with this code in it, save, then import it to your world database)
    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 (198767, 'Lizzrik Styliz', 'The Lottery Goblin', 0, 0, 7, 0, 1, 0, 0, 21640, 0, 0, 0, 1, 1, NULL, 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 (198767, 80, 80, 1555, 1000, 1000, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, '', 0, 0, 0, 0, 2.5, 8, 14, 0, 0, 0, 0, 0, 0, 0);
    Screen Shots


    I hope you take the time to read the code carefully so you can learn off of it. Once again thank you for the novel idea and the original code. I hope I did not offend you.

    +Rep to you.
    Well, its good that you come with a new version.. or something. To delete all the bugs, Im not offended at all but most of the credits goes to josh253 for the first script. I just came up with the idea and I had pretty much trouble to make a script out of it :P and thanks for releasing a updated version. +Rep to you, and rather give rep to Josh253 than to me
    "i downloaded it in "pirates bay", can you tell me how to download it in steam, pls"

  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)
    Don't be stupid Sandile, all rep goes to you. I have +rep'd you myself.

  13. #13
    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)
    Im not looking for rep anyways and you helped me with the script to 100%. Without you there whouldn't be any script and then there whouldn't be any release. So +rep to josh253.
    "i downloaded it in "pirates bay", can you tell me how to download it in steam, pls"

Similar Threads

  1. [Lua][Unique] Magnus, Parant'ol Executer
    By stoneharry in forum WoW EMU General Releases
    Replies: 17
    Last Post: 10-09-2008, 01:08 PM
  2. Lottery Money Not Scam
    By Bloodpoisen in forum World of Warcraft Guides
    Replies: 21
    Last Post: 02-06-2007, 05:17 PM
  3. Revised Lottery Scam
    By TehGoggles in forum WoW Scam Prevention
    Replies: 8
    Last Post: 01-23-2007, 09:14 PM
  4. Unique AFK bot!
    By lars1414 in forum World of Warcraft Bots and Programs
    Replies: 12
    Last Post: 12-30-2006, 07:42 AM
  5. Quick and easy guide to unique instance items at lower levels :)
    By Shanka in forum World of Warcraft Guides
    Replies: 4
    Last Post: 08-01-2006, 04:41 PM
All times are GMT -5. The time now is 12:05 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