----------------------------------THIS CODE WAS SCRIPTED BY: OTSWE------------------------------------ local random_txt_onsay = false -- When casting a wall, should the player cast random catch phrases? local otswe = { timer = 15, -- How long will the magic wall stay cooldown = 2, -- How long to cast another one words = {"BOOM"}, -- Here can you add or edit the catch phrases! txt = "GONE!", -- Text when it removes color_on_timer = TEXTCOLOR_BLUE, -- Color on countdown empty_storage = 1000 -- Please set a unused storage } function onUse(cid, item, fromPosition, itemEx, toPosition) if(getPlayerStorageValue(cid, otswe.empty_storage) > os.time()) then doPlayerSendCancel(cid, "You are exhausted.") return true end if getTileInfo(getThingPos(cid)).protection then doPlayerSendCancel(cid, "You can't cast magic wall while your inside protection zone.") else local function removemw() local magicwall = getTileItemById(toPosition, 1497).uid if(magicwall > 0) then doRemoveItem(magicwall) doSendAnimatedText(toPosition,otswe.txt, TEXTCOLOR_RED) doSendMagicEffect(toPosition, CONST_ME_ENERGYHIT) end return true end for mw = 1, otswe.timer do local o = otswe.timer - mw addEvent(doSendAnimatedText, mw * 1000, toPosition, o > 0 and tostring(o), otswe.color_on_timer) end doCreateItem(1497, toPosition) setPlayerStorageValue(cid, otswe.storage, os.time() + otswe.cooldown) addEvent(removemw, otswe.timer * 1000) doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA) end if random_txt_onsay == true then doCreatureSay(cid, otswe.words[math.random(#otswe.words)], TALKTYPE_ORANGE_1) end return true end