[Lua]Weather Controler Lua Ascent 

Socius Decennalis
Decennium
Joined
Oct 20, 2008
Messages
267
Reaction score
58
-=[[Lua]Weather Controler]=-


Description
Hi all. I maked these small Lua script. What it do??- heh lil mistic item that can change your weather to: Sunny,Foggy,Raining and Snowing.

How to work
Copy this code down change ItemID(1234) or use my item, put it in scripts save as WeatherController.lua and restart the server
Remember you need to make item or to use my...


WeatherController.sql
Code:
INSERT INTO items (entry, class, subclass, field4, name1, displayid, quality, flags, buyprice, sellprice, inventorytype, allowableclass, allowablerace, itemlevel, requiredlevel, RequiredSkill, RequiredSkillRank, RequiredSpell, RequiredPlayerRank1, RequiredPlayerRank2, RequiredFaction, RequiredFactionStanding, `Unique`, maxcount, ContainerSlots, stat_type1, stat_value1, stat_type2, stat_value2, stat_type3, stat_value3, stat_type4, stat_value4, stat_type5, stat_value5, stat_type6, stat_value6, stat_type7, stat_value7, stat_type8, stat_value8, stat_type9, stat_value9, stat_type10, stat_value10, dmg_min1, dmg_max1, dmg_type1, dmg_min2, dmg_max2, dmg_type2, armor, holy_res, fire_res, nature_res, frost_res, shadow_res, arcane_res, delay, ammo_type, `range`, spellid_1, spelltrigger_1, spellcharges_1, spellcooldown_1, spellcategory_1, spellcategorycooldown_1, spellid_2, spelltrigger_2, spellcharges_2, spellcooldown_2, spellcategory_2, spellcategorycooldown_2, spellid_3, spelltrigger_3, spellcharges_3, spellcooldown_3, spellcategory_3, spellcategorycooldown_3, spellid_4, spelltrigger_4, spellcharges_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4, spellid_5, spelltrigger_5, spellcharges_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5, bonding, description, page_id, page_language, page_material, quest_id, lock_id, lock_material, sheathID, randomprop, randomsuffix, block, itemset, MaxDurability, ZoneNameID, mapid, bagfamily, TotemCategory, socket_color_1, unk201_3, socket_color_2, unk201_5, socket_color_3, unk201_7, socket_bonus, GemProperties, ReqDisenchantSkill, ArmorDamageModifier, itemstatscount)
VALUES (1234, 0, 8, -1, "Weather Changer", 61330, 3, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0,  0, 0,  0, 0,  0, 0,  0, 0,  0, 0,  0, 0,  0, 0,  0, 0,  0, 0,  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "Strange magic is flying around this thing.Lunar Scriptors", 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10);
WeatherController.lua
Code:
-=[LunarSCR-Onlykl]=-


local Item_ID = [COLOR="Red"]1234[/COLOR] -- Change that to your Item ID ;) 
function Item_Trigger(item, event, player)
Item_menu(item, player)
end

function Item_menu(item, player)
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("You are in combat!")
else
item:GossipCreateMenu(**** player, 0)
item:GossipMenuAddItem(1, "|cffff0000Weather Control", 1, 0)
item:GossipSendMenu(player)
end
end

function OnSelect(item, event, player, id, intid, code)
if (intid == 1) then
item:GossipCreateMenu(*** player, 0)
item:GossipMenuAddItem(5, "|cffffff00Sunny", 2, 0)
item:GossipMenuAddItem(5, "|cff888888Foggy", 3, 0)
item:GossipMenuAddItem(5, "|cFF00FFFFRaining", 4, 0)
item:GossipMenuAddItem(5, "|cFFFFFAF0Snowing", 5, 0)
item:GossipMenuAddItem(2, "|cffff0000<- Back", **** 0)
item:GossipSendMenu(player)
end

if(intid == 2) then
player:SetPlayerWeather(0, 1)
player:SendBroadcastMessage("Weather Changed to Sunny.")
player:GossipComplete()
end
  
if(intid == 3) then
player:SetPlayerWeather(1, 1)
player:SendBroadcastMessage("Weather Changed to Foggy.")
player:GossipComplete()
end
 
if(intid == 4) then
player:SetPlayerWeather(2, 1)
player:SendBroadcastMessage("Weather Changed to Raining.")
player:GossipComplete()
end

if(intid == 5) then
player:SetPlayerWeather(8, 1)
player:SendBroadcastMessage("Weather Changed to Snowing.")
player:GossipComplete()
end
end

RegisterItemGossipEvent("Item_ID", 1, "Lunar_Trigger")
RegisterItemGossipEvent("Item_ID", 2, "On_LunarSelect")
 
Back