Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Done and coded by Breezicreaf*/
- SET @NpcID :='X'; -- ID of npc HERE
- SET @GossipID :='X'; -- Gossip ID here
- SET @ItemID1 :='X'; -- Item you can win when you gamble for 5 Tokens
- SET @ItemID2 :='X'; -- Item you can win when you gamble for 10 Tokens
- SET @ItemID3 :='X'; -- Item you can win when you gamble for 25 Tokens
- SET @ItemID4 :='X'; -- Item you can win when you gamble for 50 Tokens
- SET @ItemID5 :='X'; -- Item you can win when you gamble for 100 Tokens
- SET @Chance :='X'; -- The chance of winning an item between 1 and 100
- /*Don't EDIT below this part, unless you want to change the amount and name of the items*/
- DELETE FROM creature_template WHERE entry =@NpcID;
- INSERT INTO creature_template (entry, modelid1, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, Health_mod, Mana_mod, Armor_mod, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, dmg_multiplier, unit_class, unit_flags, TYPE, type_flags, InhabitType, RegenHealth, flags_extra, AiName) VALUES
- (@NpcID, '21572', "Stein Bagger", "Gamble Npc", NULL, @GossipID, 71, 71, 1.56, 1.56, 1.56, 1161, 1161, 3, 1, 1.14286, 1.25, 1, 1, 1, 2, 7, 138936390, 3, 1, 2, 'SmartAI');
- DELETE FROM gossip_menu_option WHERE menu_id =@GossipID;
- INSERT INTO gossip_menu_option (menu_id, id, option_icon, option_text, option_id, npc_option_npcflag, action_menu_id, action_poi_id, box_coded, box_money, box_text) VALUES
- (@GossipID, 0, 10, '|CFFFFFFFF---------|r|CFF003333[Stein Begger]|r|CFFFFFFFF---------|r', 1, 1, 0, 0, 0, 0, NULL),
- (@GossipID, 1, 10, '|CFF003333Gamble|r|CFFFFFFFF:|r 5 Gamble Tokens', 1, 1, 0, 0, 0, 0, 'Are you sure you want to gamble?'),
- (@GossipID, 2, 10, '|CFF003333Gamble|r|CFFFFFFFF:|r 10 Gamble Tokens', 1, 1, 0, 0, 0, 0, 'Are you sure you want to gamble?'),
- (@GossipID, 3, 10, '|CFF003333Gamble|r|CFFFFFFFF:|r 25 Gamble Tokens', 1, 1, 0, 0, 0, 0, 'Are you sure you want to gamble?'),
- (@GossipID, 4, 10, '|CFF003333Gamble|r|CFFFFFFFF:|r 50 Gamble Tokens', 1, 1, 0, 0, 0, 0, 'Are you sure you want to gamble?'),
- (@GossipID, 5, 10, '|CFF003333Gamble|r|CFFFFFFFF:|r 100 Gamble Tokens', 1, 1, 0, 0, 0, 0, 'Are you sure you want to gamble?'),
- (@GossipID, 6, 10, '|CFF003333Gamble Npc|r|CFFFFFFFF:|r Hello i`m your local gamble npc. To watch my gamble offers you will need the required amount of tokens. I gamble with 5 tokens, 10 tokens, 25 tokens, 50 tokens, and, 100 tokens!', 1, 1, 0, 0, 0, 0, NULL);
- /*SmartAI to add item if won, and remove item that has been gambled*/
- DELETE FROM smart_scripts WHERE entryorguid =@NpcID;
- INSERT INTO smart_scripts (entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment) VALUES
- (@NpcID, 0, 1, 1, 62, 0, @Chance, 0, @GossipID, 1, 0, 0, 56, @ItemID1, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gamble 5 Tokens'),
- (@NpcID, 0, 2, 1, 62, 0, @Chance, 0, @GossipID, 2, 0, 0, 56, @ItemID2, 20, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gamble 10 Tokens'),
- (@NpcID, 0, 3, 1, 62, 0, @Chance, 0, @GossipID, 3, 0, 0, 56, @ItemID3, 50, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gamble 25 Tokens'),
- (@NpcID, 0, 4, 1, 62, 0, @Chance, 0, @GossipID, 4, 0, 0, 56, @ItemID4, 100, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gamble 50 Tokens'),
- (@NpcID, 0, 5, 1, 62, 0, @Chance, 0, @GossipID, 5, 0, 0, 56, @ItemID5, 200, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Gamble 100 Tokens'),
- (@NpcID, 0, 6, 0, 62, 0, 100, 0, @GossipID, 1, 0, 0, 57, @ItemID1, 5, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Remove 5 Tokens'),
- (@NpcID, 0, 7, 0, 62, 0, 100, 0, @GossipID, 2, 0, 0, 57, @ItemID2, 10, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Remove 10 Tokens'),
- (@NpcID, 0, 8, 0, 62, 0, 100, 0, @GossipID, 3, 0, 0, 57, @ItemID3, 25, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Remove 25 Tokens'),
- (@NpcID, 0, 9, 0, 62, 0, 100, 0, @GossipID, 4, 0, 0, 57, @ItemID4, 50, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Remove 50 Tokens'),
- (@NpcID, 0, 10, 0, 62, 0, 100, 0, @GossipID, 5, 0, 0, 57, @ItemID5, 100, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Remove 100 Tokens');
- /*Conditions to make sure you can't cheat*/
- DELETE FROM conditions WHERE SourceGroup =@GossipID;
- INSERT INTO conditions (SourceTypeOrReferenceId, SourceGroup, SourceEntry, ConditionTypeOrReference, ConditionValue1, ConditionValue2, Comment) VALUES
- (15, @GossipID, 1, 2, @ItemID1, 5, '5 Token'),
- (15, @GossipID, 2, 2, @ItemID2, 10, '10 Token'),
- (15, @GossipID, 3, 2, @ItemID1, 25, '25 Token'),
- (15, @GossipID, 4, 2, @ItemID2, 50, '50 Token'),
- (15, @GossipID, 5, 2, @ItemID1, 100, '100 Token');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement