-- Create the Mango Script Base object HGS_rainbow = Mango.Scripts.Create('hgs_rainbow'); HGS_rainbow:ForceLUA(); -- Don't use the CPP version if valid -- Function prototypes (to keep it clean) local HGS_rainbow_GossipHello local HGS_rainbow_GossipSelect local iwanna = "I want to " local icons = { 1 , 2, 6, 9 } local whattodo = { "buy stuff." , "be invincible." , "get rich fast!" , "be honored." } -- The actual functions -- Send the first menu (with the selections) function HGS_rainbow_GossipHello(player,_Creature) local i = 1 local icon = 10 while whattodo[i] do icon = 10 if icons[i] > 0 and icons[i] < 14 then icon = icons[i] end player:ADD_GOSSIP_ITEM( icon, iwanna..whattodo[i] , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + i) i = i + 1 end player:SEND_GOSSIP_MENU(1 ,_Creature:GetGUID()); -- Says " Greetings " return RETURN_OK end function HGS_rainbow_GossipSelect(player, _Creature, sender, action) if action == GOSSIP_ACTION_INFO_DEF + 1 then --buy stuff player:SEND_VENDORLIST(_Creature:GetGUID()) end if action == GOSSIP_ACTION_INFO_DEF + 2 then --not die --player:StoreItem(255, player:CreateItem(22116, 1), true) --LuaAI:DoCast(player:GetGUID(), 27239) _Creature:MonsterSay("Shizam!", 0) player:CLOSE_GOSSIP_MENU() end if action == GOSSIP_ACTION_INFO_DEF + 3 then --get rich fast player:ModifyMoney(10000000) --100K GOLD player:CLOSE_GOSSIP_MENU() end if action == GOSSIP_ACTION_INFO_DEF + 4 then --set honor --player:SetHonorHighestRank() player:CLOSE_GOSSIP_MENU() end --player:SEND_GOSSIP_MENU(1, _Creature:GetGUID()) return RETURN_OK end -- Assign the functions HGS_rainbow.GossipHello = HGS_rainbow_GossipHello; HGS_rainbow.GossipSelect= HGS_rainbow_GossipSelect; -- Activate (run) the script HGS_rainbow:Activate();