Solutions
-
Coltera's post in (Resolvido)ACTION NO INTEM was marked as the answer@Vitorelias
local message = {"No meu corpo descansarei em paz", "sssshhhhh", "Encontre meu corpo", "Quero descansar em paz"} function onUse(cid, item, fromPosition, itemEx, toPosition) doCreatureSay(cid, message[math.random(1, #message)], TALKTYPE_ORANGE_1) return true end
-
Coltera's post in (Resolvido)Look Reset TFS1.3 was marked as the answer@BilauX
Em data/events/scripts/player.lua
Na função:
function Player:onLook(thing, position, distance) Adicione:
if thing:isPlayer() then local resets = thing:getStorageValue(378378) if resets < 0 and 0 or resets then description = string.format("%s\nResets: %s.", description, resets > 0 and resets or "0") end end Se preferir você também pode usar na função:
function Player:onLookInBattleList(creature, distance) Para mostrar os resets ao da look pela battle.
-
Coltera's post in (Resolvido)Remover Walls após boss morto TFS 1.2 was marked as the answer@Yinz
function onDeath(monster, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified) -- ID do item que será removido e criado local item_id = 1285 -- Posição do item que será removido e criado local pos_item = Position(1066, 1050, 7) local check_pos_item = Tile(pos_item):getItemById(item_id) local monster_name = "Dragon Lord" -- Tempo para criar o item que foi removido local time = 10*1000 -- 10 segundos.. if monster:getName() == monster_name then if check_pos_item then check_pos_item:remove() pos_item:sendMagicEffect(3) monster:say("O BOSS foi morto. A passagem foi aberta e fechará em 10 segundos.", TALKTYPE_ORANGE_1) addEvent(function() Game.createItem(item_id, 1, pos_item) end, time) end end return true end
-
Coltera's post in (Resolvido)Leve Monster TFS 1.3 was marked as the answer@Yinz
local config = { monster_name = "Dragon Lord", monster_position = Position(1063, 1052, 7), storage = 6025, ex_time = 1*60 } function onUse(player, item, frompos, item2, topos) if not player:getPlayer() then return true end if player:getStorageValue(config.storage) >= os.time() then player:sendTextMessage(MESSAGE_INFO_DESCR, "You can only use in "..string.diff(player:getStorageValue(config.storage) - os.time())) else player:setStorageValue(config.storage, os.time() + config.ex_time) Game.createMonster(config.monster_name, config.monster_position) item:transform(item.itemid == 9826 and 9825 or 9826) end return true end
-
Coltera's post in (Resolvido)WIDGET TOP RANK COM RESET was marked as the answer@BilauX
<?php $skills = $SQL->query('SELECT * FROM players WHERE deleted = 0 AND group_id = 1 AND account_id != 1 ORDER BY reset DESC LIMIT 10'); ?> <style type="text/css" media="all"> .Toplevelbox { top: -4px; position: relative; margin-bottom: 10px; width: 180px; height: 346px; } .top_level_x { position: absolute; top: 29px; left: 6px; height: 290px; width: 168px; z-index: 20; text-align: center; padding-top: 6px; font-family: Tahoma, Geneva, sans-serif; font-size: 9.2pt; color: black; font-weight: bold; text-align: right; text-decoration: inherit; text-shadow: 0.1em 0.1em #333 } .top_level { position: absolute; top: 29px; left: 6px; height: 300px; width: 168px; z-index: 20; text-align: center; padding-top: 6px; font-family: Tahoma, Geneva, sans-serif; font-size: 9.2pt; color: black; font-weight: bold; text-align: right; text-decoration: inherit; text-shadow: 0.1em 0.1em #333 } #Topbar a { text-decoration: none; cursor: auto; } a.topfont { font-family: Verdana, Arial, Helvetica; font-size: 11px; color: #ffcc33; text-decoration: none text-shadow: #FA0606 1px 1px 10px; } a:hover.topfont { font-family: Verdana, Arial, Helvetica; font-size: 11px; color: #CCC; text-decoration:none } </style> <div id="Topbar" class="Themebox" style="background-image:url(<?PHP echo $layout_name; ?>/images/top_level.png);"> <div class="top_level" style="background:url(<?PHP echo $layout_name; ?>/images/bg_top.png)" align=" "> <?php $a = 1; foreach($skills as $skill) { echo '<div align="left"> <a href="?subtopic=characters&name='.$skill['name'].'" class="topfont"> <font color="#CCC"> '.$a.' - </font>'.$skill['name'].' <br> <small><font color="white"> Level: ('.$skill['level'].'), Reset: ['.$skill['reset'].']</font></small> <br> </a> <img src="/images/outfit.php?id='.$skill['looktype'].'&addons='.$skill['lookaddons'].'&head='.$skill['lookhead'].'&body='.$skill['lookbody'].'&legs='.$skill['looklegs'].'&feet='.$skill['lookfeet'].'" width="64" height="64" style="width: 64px; height: 64px; position: absolute; background-position: 0 0; background-repeat: no-repeat; left: -50px; margin-top: -70px;"> </div>'; $a++; } ?>
-
Coltera's post in (Resolvido)Mudando a cor de fundo do Submenu was marked as the answer@Phineasz Se eu não me engano fica em:
initialize.js
function MouseOverSubmenuItem(source) { source.style.backgroundColor = "#14433f"; } function MouseOutSubmenuItem(source) { source.style.backgroundColor = "#0d2e2b"; }
-
Coltera's post in (Resolvido)NPC vendendo por Tokens TFS 1.2 was marked as the answerNão fiz a dos items porque estou sem tempo.
Mas ta aí a das montarias.
Não testado 100%.
LIB:
function Player.getTokens(self) local query = db.storeQuery("SELECT `tokens` FROM accounts WHERE `id` = "..self:getAccountId()) if not query then return 0 end local tokens = result.getDataInt(query, "tokens") or 0 result.free(query) return tokens end function Player.removeTokens(self, count) return db.query("UPDATE `accounts` SET `tokens` = "..self:getTokens() - count.." WHERE `id` = "..self:getAccountId()) end NPC:
local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) local player = Player(cid) local mounts = { ["Widow Queen"] = {tokens = 500, mountId = 1}, ["Racing Bird"] = {tokens = 500, mountId = 2}, } if(not npcHandler:isFocused(cid)) then return false end if msg == "montarias" then npcHandler:say("Montarias disponível no momento {Widow Queen} e {Racing Bird}.", cid) return true end if mounts[msg] then if not player:hasMount(mounts[msg].mountId) then if player:getTokens() >= mounts[msg].tokens then npcHandler:say("Você comprou a montaria {"..msg.."} por "..mounts[msg].tokens.." tokens", cid) player:removeTokens(mounts[msg].tokens) player:addMount(mounts[msg].mountId) else npcHandler:say("Você precisa de {"..mounts[msg].tokens.." tokens} para comprar esta montaria.", cid) end else npcHandler:say("Você já possui esta montaria.", cid) end else npcHandler:say("A montaria {"..msg.."} não existe.", cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Coltera's post in (Resolvido)Advance level, reward points. was marked as the answerTesta aí @Jobs
local points = 5 local storage = 1234 function onAdvance(player, skill, oldLevel, newLevel) if skill ~= SKILL_LEVEL or newLevel <= oldLevel then return true end if player:getStorageValue(storage) < oldLevel then db.query("UPDATE `accounts` SET `NOVA_TABELA` = `NOVA_TABELA` + " .. points .. " WHERE `id` = '" .. player:getAccountId() .. "';") player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, 'Congratulations! You have advanced to level ' .. newLevel .. ' and you have earned '.. points ..' points!') player:setStorageValue(storage, oldLevel) end return true end