Ir para conteúdo
Close

Conheça já nossa seção de classificados, faça já gratuitamente o seu anuncio ou apenas procure por produtos relacionados ao OTServ! Acesse através do nosso menu ou clique aqui e confira já!

Danyel Varejao

Membro
  • Total de itens

    74
  • Registro em

  • Última visita

  • Dias Ganhos

    6

Danyel Varejao venceu a última vez em Dezembro 22 2017

Danyel Varejao teve o conteúdo mais curtido!

6 Seguidores

Sobre Danyel Varejao

  • Rank
    Ferreiro
  • Data de Nascimento 12/07/1997

Informação de Perfil

  • Genero
    Masculino
  • Localização
    Pernambuco - Recife
  • Eu sou
    Programmer
  • Interesses
    Suporte LUA (100%)
    Contato: https://www.facebook.com/Danyel.Varejao

Últimos Visitantes

O bloco dos últimos visitantes está desativado e não está sendo visualizado por outros usuários.

  1. @poko360 me fala como você quer, com os magic effect etc, que da pra fazer tudo na source mesmo, além de mais otimizado seria a melhor forma pra isso sem consumir muito processamento.
  2. Em game.cpp procure por: bool Game::playerMove(uint32_t playerId, Direction dir) Dentro dessa função terá isso daqui: if(player->getNoMove()) { player->sendCancelWalk(); return false; } Logo abaixo adicione isso: std::string value; player->getStorage("6000", value); int32_t playerStorage = atoi(value.c_str()); if(playerStorage > 0) { player->sendCancelWalk(); return false; } Feche, salve, compile novamente e teste.
  3. Troca a lib para esta e veja se corrige. --[[ Auto Loot System by Danyel Varejão ]] AutoLoot = { Min_Level = 100, -- Level minimo pra utilizar o auto loot. Max_Slots = 5, -- Máximo de slots permitidos. Boost_Actived = true, -- Nao mexa daqui pra baixo caso nao entenda -- Storage_Boost = 45000, Storage_On_Items = 45001, Storage_On_Gold = 45002, Storages = { Count_Gold = 45003, Count_Items = 45004, Count_Table = 45005, Slots = {45006, 45007, 45008, 45009, 45010} -- Storage pra cada slot. } } AutoLoot_Boost = { -- [ID do item] = Valor, [2406] = 36, [2537] = 4800, [2377] = 480, [2663] = 600, [2472] = 240000, [2398] = 36, [2475] = 7200, [2519] = 6000, [2497] = 10800, [2523] = 180000, [2494] = 108000, [2400] = 144000, [2491] = 6000, [2421] = 108000, [2646] = 240000, [2477] = 7200, [2413] = 84, [2656] = 18000, [2498] = 48000, [2647] = 600, [2534] = 30000, [7402] = 24000, [2466] = 36000, [2465] = 240, [2408] = 120000, [2518] = 1800, [2500] = 3000, [2376] = 30, [2470] = 96000, [2388] = 24, [2645] = 48000, [2434] = 2400, [2463] = 480, [2536] = 9600, [2387] = 240, [2396] = 4800, [2381] = 240, [2528] = 4800, [2409] = 1800, [2414] = 12000, [2427] = 9000, [2407] = 7200, [2458] = 42, [2383] = 960, [2392] = 3600, [2488] = 18000, [2525] = 120, [2423] = 240, [2462] = 4800, [2520] = 48000, [2390] = 180000, [2417] = 72, [2436] = 1200, [5741] = 42000, [2378] = 120, [2487] = 24000, [2476] = 6000, [8891] = 36000, [2459] = 36, [2195] = 48000, [2391] = 7200, [2464] = 120, [8889] = 72000, [2432] = 12000, [2431] = 108000, [2492] = 72000, [2515] = 240, [2430] = 2400, [2393] = 12000, [7419] = 36000, [2522] = 120000, [2514] = 180000 } function AutoLoot.CountTable(table) local Count = 0 if type(table) == "table" then for index in pairs(table) do Count = Count + 1 end return Count end return false end function AutoLoot.getContainerItemsInfo(ContainerUID) local Table = {} if ContainerUID and ContainerUID > 0 then local Index = 0 for i = 0, getContainerSize(ContainerUID) - 1 do local item = getContainerItem(ContainerUID, i) Index = Index + 1 Table[Index] = {UID = item.uid, ItemID = item.itemid, Count = item.type} end return Table end return false end function AutoLoot.String(String) local Table = {} local x, old, last = 0, 0, 0 local first, second, final = 0, 0, 0 if type(String) ~= "string" then return Table end for i = 2, #String - 1 do if string.byte(String:sub(i,i)) == string.byte(':') then x, second, last = x + 1, i - 1, i + 2 for t = last, #String - 1 do if string.byte(String:sub(t,t)) == string.byte(',') then first = x == 1 and 2 or old old, final = t + 2, t - 1 local Index = String:sub(first, second) local Var = String:sub(last, final) Table[tonumber(Index) or tostring(Index)] = tonumber(Var) or tostring(Var) break end end end end return Table end function AutoLoot.TranslateString(Table) local String = "" if type(Table) ~= "table" then return String end for i, last in pairs(Table) do String = String..i..": ".. last ..", " end String = "a"..String.."a" return tostring(String) end function AutoLoot.getPlayerStorageZero(cid, key) return getPlayerStorageValue(cid, key) > 0 and getPlayerStorageValue(cid, key) or 0 end function AutoLoot.getStorageZero(key) return getGlobalStorageValue(key) > 0 and getGlobalStorageValue(key) or 0 end function AutoLoot.setPlayerTableStorage(cid, key, value) return doPlayerSetStorageValue(cid, key, AutoLoot.TranslateString(value)) end function AutoLoot.setGlobalTableStorage(key, value) return setGlobalStorageValue(key, AutoLoot.TranslateString(value)) end function AutoLoot.getPlayerTableStorage(cid, key) return AutoLoot.String(getPlayerStorageValue(cid, key)) end function AutoLoot.getGlobalTableStorage(key) return AutoLoot.String(getGlobalStorageValue(key)) end function AutoLoot.getPlayerList(cid) local Table = {} for i = 1, #AutoLoot.Storages.Slots do if getPlayerStorageValue(cid, AutoLoot.Storages.Slots[i]) ~= -1 then table.insert(Table, getPlayerStorageValue(cid, AutoLoot.Storages.Slots[i])) end end return Table end function AutoLoot.ExistItemByName(name) local Items = io.open("data/items/items.xml", "r"):read("*all") local GetITEM = Items:match('name="' .. name ..'"') if GetITEM == nil or GetITEM == "" then return false end return true end function AutoLoot.addToList(cid, name) local ItemID = getItemIdByName(name) if AutoLoot.getPlayerList(cid) and isInArray(AutoLoot.getPlayerList(cid), ItemID) then return false end for i = 1, #AutoLoot.Storages.Slots do if getPlayerStorageValue(cid, AutoLoot.Storages.Slots[i]) == -1 then doPlayerSetStorageValue(cid, AutoLoot.Storages.Slots[i], ItemID) return true end end end function AutoLoot.removeFromList(cid, name) local ItemID = getItemIdByName(name) for i = 1, #AutoLoot.Storages.Slots do if getPlayerStorageValue(cid, AutoLoot.Storages.Slots[i]) == ItemID then doPlayerSetStorageValue(cid, AutoLoot.Storages.Slots[i], -1) return true end end return false end function AutoLoot.Boost(cid) return tonumber(getPlayerStorageValue(cid, AutoLoot.Storage_Boost)) >= os.time() end function AutoLoot.Items(cid, position) if not isPlayer(cid) then return true end local Check, String, Position = false, "", {} for i = 1, 255 do position.stackpos = i if getThingFromPos(position).uid and getThingFromPos(position).uid > 0 and isContainer(getThingFromPos(position).uid) then Position = position Check = true break end end if Check then local CorpseUID = AutoLoot.getContainerItemsInfo(getThingFromPos(Position).uid) if CorpseUID then for Index, Item in pairs(CorpseUID) do if Index < AutoLoot.CountTable(CorpseUID) then if Item.UID and Item.ItemID then if isContainer(Item.UID) then local Bag = AutoLoot.getContainerItemsInfo(Item.UID) for i = 1, AutoLoot.CountTable(Bag) do if isInArray(AutoLoot.getPlayerList(cid), Bag[i].ItemID) then if Bag[i].Count > 1 then if Bag[i].uid and Bag[i].uid > 0 then doRemoveItem(Bag[i].uid, Bag[i].Count) end doPlayerAddItem(cid, Bag[i].ItemID, Bag[i].Count) String = String.." ".. Bag[i].Count .." ".. getItemNameById(Bag[i].ItemID) .." +" else if Bag[i].uid and Bag[i].uid > 0 then doRemoveItem(Bag[i].uid) end if AutoLoot.Boost_Actived and AutoLoot.Boost(cid) then if AutoLoot_Boost[Bag[i].ItemID] then doPlayerSetBalance(cid, getPlayerBalance(cid) + AutoLoot_Boost[Bag[i].ItemID]) String = String.." 1 ".. getItemNameById(Bag[i].ItemID) .." (".. AutoLoot_Boost[Bag[i].ItemID] .."gp no banco) +" else doPlayerAddItem(cid, Bag[i].ItemID, 1) String = String.." 1 ".. getItemNameById(Bag[i].ItemID) .." +" end else doPlayerAddItem(cid, Bag[i].ItemID, 1) String = String.." 1 ".. getItemNameById(Bag[i].ItemID) .." +" end end end end end end end if isInArray(AutoLoot.getPlayerList(cid), Item.ItemID) then if Item.Count > 1 then if Item.UID and Item.UID > 0 then doRemoveItem(Item.UID, Item.Count) end doPlayerAddItem(cid, Item.ItemID, Item.Count) String = String.." ".. Item.Count .." ".. getItemNameById(Item.ItemID) .." +" else if Item.UID and Item.UID > 0 then doRemoveItem(Item.UID) end if AutoLoot.Boost_Actived and AutoLoot.Boost(cid) then if AutoLoot_Boost[Item.ItemID] then doPlayerSetBalance(cid,getPlayerBalance(cid) + AutoLoot_Boost[Item.ItemID]) String = String.." 1 "..getItemNameById(Item.ItemID).." ("..AutoLoot_Boost[Item.ItemID].."gps no banco) +" else doPlayerAddItem(cid, Item.ItemID, 1) String = String.." 1 "..getItemNameById(Item.ItemID).." +" end else doPlayerAddItem(cid, Item.ItemID, 1) String = String.." 1 "..getItemNameById(Item.ItemID).." +" end end end end end end AutoLoot.setPlayerTableStorage(cid, AutoLoot.Storages.Count_Table, {[1] = String, [2] = 0}) end function AutoLoot.Gold(cid, position) if not isPlayer(cid) then return true end local Check = false local Total_Gold = 0 local Position = {} for i = 1, 255 do position.stackpos = i if getThingFromPos(position).uid and getThingFromPos(position).uid > 0 and isContainer(getThingFromPos(position).uid) then Position = position Check = true break end end if Check then local CorpseUID = AutoLoot.getContainerItemsInfo(getThingFromPos(Position).uid) if CorpseUID then for Index, Item in pairs(CorpseUID) do if Item.UID and Item.ItemID then if Index < AutoLoot.CountTable(CorpseUID) then if isContainer(Item.UID) then local Bag = AutoLoot.getContainerItemsInfo(Item.UID) for i = 1, AutoLoot.CountTable(Bag) do if isInArray({2148, 2152, 2160}, Bag[i].ItemID) then local Multiplier = 1 if Bag[i].ItemID == 2148 then Multiplier = 1 elseif Bag[i].ItemID == 2152 then Multiplier = 100 elseif Bag[i].ItemID == 2160 then Multiplier = 10000 end if Bag[i].uid and Bag[i].uid > 0 then doRemoveItem(Bag[i].uid, Bag[i].Count) end doPlayerSetBalance(cid, getPlayerBalance(cid) + tonumber(Bag[i].Count) * Multiplier) Total_Gold = Total_Gold + Bag[i].Count * Multiplier doPlayerSetStorageValue(cid, AutoLoot.Storages.Count_Gold, tonumber(AutoLoot.getPlayerStorageZero(cid, AutoLoot.Storages.Count_Gold)) + tonumber(Item.Count) * tonumber(Multiplier)) end end end end if isInArray({2148, 2152, 2160}, Item.ItemID) then local Multiplier = 1 if Item.ItemID == 2148 then Multiplier = 1 elseif Item.ItemID == 2152 then Multiplier = 100 elseif Item.ItemID == 2160 then Multiplier = 10000 end if Item.UID and Item.UID > 0 then doRemoveItem(Item.UID, Item.Count) end doPlayerSetBalance(cid, getPlayerBalance(cid) + Item.Count * Multiplier) doPlayerSetStorageValue(cid, AutoLoot.Storages.Count_Gold, tonumber(AutoLoot.getPlayerStorageZero(cid, AutoLoot.Storages.Count_Gold)) + tonumber(Item.Count) * tonumber(Multiplier)) Total_Gold = Total_Gold + Item.Count * Multiplier end end end end end if Total_Gold > 0 then Total_Gold = Total_Gold - (Total_Gold * 0.2) Total_Gold = math.ceil(Total_Gold) doPlayerSetBalance(cid, getPlayerBalance(cid) + Total_Gold) local Table = AutoLoot.getPlayerTableStorage(cid, AutoLoot.Storages.Count_Table) Table[2] = Total_Gold AutoLoot.setPlayerTableStorage(cid, AutoLoot.Storages.Count_Table, Table) end end function AutoLoot.Message(cid) if not isPlayer(cid) then return true end local Table = AutoLoot.getPlayerTableStorage(cid, AutoLoot.Storages.Count_Table) if AutoLoot.CountTable(Table) >= 1 then if Table[1] then if Table[2] and Table[2] > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: ".. Table[1] .." ".. Table[2] .." gold coins.") else if type(Table[1]) == "string" and string.len(Table[1]) > 1 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..Table[1]) end end elseif not Table[1] then if Table[2] then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..Table[2].." gold coins.") end end end doPlayerSetStorageValue(cid, AutoLoot.Storages.Count_Table, -1) end
  4. Poste seu script aqui. data/spells/scripts/support/sharpshooter.lua
  5. <?php if(!defined('INITIALIZED')) exit; if(count($config['site']['worlds']) > 1) { foreach($config['site']['worlds'] as $idd => $world_n) { if($idd == (int) $_REQUEST['world']) { $world_id = $idd; $world_name = $world_n; } } } if(!isset($world_id)) { $world_id = 0; $world_name = $config['server']['serverName']; } if(count($config['site']['worlds']) > 1) { $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD></TD><TD> <FORM ACTION="" METHOD=get><INPUT TYPE="hidden" NAME="subtopic" VALUE="whoisonline"><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"> <TABLE BORDER=0 CELLPADDING=1><TR><TD>Players online on world:</TD><TD><SELECT SIZE="1" NAME="world">'; foreach($config['site']['worlds'] as $id => $world_n) { if($id == $world_id) $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'" selected="selected">'.htmlspecialchars($world_n).'</OPTION>'; else $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'">'.htmlspecialchars($world_n).'</OPTION>'; } $main_content .= '</SELECT> </TD><TD><INPUT TYPE="image" NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif"> </TD></TR></TABLE></TABLE></FORM></TABLE>'; } $orderby = 'name'; if(isset($_REQUEST['order'])) { if($_REQUEST['order']== 'level') $orderby = 'level'; elseif($_REQUEST['order'] == 'vocation') $orderby = 'vocation'; } $players_online_data = $SQL->query('SELECT ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('flag') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('vocation') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('promotion') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('level') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('skull') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looktype') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookaddons') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookhead') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookbody') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looklegs') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookfeet') . ' FROM ' . $SQL->tableName('accounts') . ', ' . $SQL->tableName('players') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('world_id') . ' = ' . $SQL->quote($world_id) . ' AND ' . $SQL->tableName('players') . '.' . $SQL->fieldName('online') . ' = ' . $SQL->quote(1) . ' AND ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players') . '.' . $SQL->fieldName('account_id') . ' ORDER BY ' . $SQL->fieldName($orderby))->fetchAll(); $number_of_players_online = 0; $vocations_online_count = array(0,0,0,0,0); // change it if you got more then 5 vocations $players_rows = ''; foreach($players_online_data as $player) { $vocations_online_count[$player['vocation']] += 1; $bgcolor = (($number_of_players_online++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $skull = ''; if ($player['skull'] == 4) $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>"; else if ($player['skull'] == 5) $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>"; $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=5%><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player['looktype'] . '&addons=' . $player['lookaddons'] . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" /></td><TD WIDTH=65%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).$skull.'<img src="' . $config['site']['flag_images_url'] . $player['flag'] . $config['site']['flag_images_extension'] . '" title="Country: ' . $player['flag'] . '" alt="' . $player['flag'] . '" /></A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=10%>'.$towns_list[$player->getWorld()][$player->getTownId()].'</TD><TD WIDTH=20%>'.htmlspecialchars($vocation_name[$player['promotion']][$player['vocation']]).'</TD></TR>'; } if($number_of_players_online == 0) { //server status - server empty $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently no one is playing on <b>'.htmlspecialchars($config['site']['worlds'][$world_id]).'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>'; } else { //server status - someone is online $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently '.$number_of_players_online.' players are online - <b>'.$config['status']['serverStatus_players'] .' ' . (($config['status']['serverStatus_players'] > 1) ? 'are' : 'is') . ' active</b> and <b>'.($number_of_players_online-$config['status']['serverStatus_players']).' ' . (($number_of_players_online-$config['status']['serverStatus_players'] > 1) ? 'are' : 'is') . ' AFK</b> on <b>'.htmlspecialchars($config['site']['worlds'][$world_id]).'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>'; $main_content .= '<table width="200" cellspacing="1" cellpadding="0" border="0" align="center"> <tbody> <tr> <tr bgcolor="'.$config['site']['darkborder'].'"> <td><img src="images/vocations/sorcerer.png" /></td> <td><img src="images/vocations/druid.png" /></td> <td><img src="images/vocations/paladin.png" /></td> <td><img src="images/vocations/knight.png" /></td> </tr> <tr> <tr bgcolor="'.$config['site']['vdarkborder'].'"> <td style="text-align: center;"><strong style="color:white">Sorcerers</strong></td> <td style="text-align: center;"><strong style="color:white">Druids</strong></td> <td style="text-align: center;"><strong style="color:white">Paladins</strong></td> <td style="text-align: center;"><strong style="color:white">Knights</strong></td> </tr> <tr> <TR BGCOLOR="'.$config['site']['lightborder'].'"> <td style="text-align: center;">'.$vocations_online_count[1].'</td> <td style="text-align: center;">'.$vocations_online_count[2].'</td> <td style="text-align: center;">'.$vocations_online_count[3].'</td> <td style="text-align: center;">'.$vocations_online_count[4].'</td> </tr> </tbody> </table> <div style="text-align: center;">&nbsp;</div>'; //list of players $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS="white"><b>Outfit</b></TD><TD><A HREF="?subtopic=whoisonline&order=name&world='.$world_id.'" CLASS=white>Name</A></TD><TD><A HREF="?subtopic=whoisonline&order=level&world='.urlencode($world_id).'" CLASS=white>Level</A></TD><TD><A HREF="?subtopic=whoisonline&order=vocation&world='.urlencode($world_id).'" CLASS=white>Vocation</TD></TR>'.$players_rows.'</TABLE>'; //search bar $main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post> <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE="" SIZE="29" MAXLENGTH="29"></TD><TD><INPUT TYPE="image" NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>'; }
  6. Fala galerinha do TK, aqui vai um script muito útil para vários servidores. O script serve para salvar o player e a house do mesmo, utilizando o comando !save. O script foi testado em OTXServer 2. local Configs = { Exhausted = 180, Storage_Exhausted = 5000001, Messages = { SALVED = "You character has been salved.", EXHAUST = "You need wait %d seconds to save again.", }, } local function doSavePlayerAndHouse(cid) doPlayerSave(cid) if getHouseByPlayerGUID(getPlayerGUID(cid)) then doSaveHouse(getHouseByPlayerGUID(getPlayerGUID(cid))) end return true end function onSay(cid, words, param) if getPlayerStorageValue(cid, Configs.Storage_Exhausted) >= os.time() then doPlayerSendCancel(cid, string.format(Configs.Messages.EXHAUST, getPlayerStorageValue(cid, Configs.Storage_Exhausted) - os.time())) return true end doSavePlayerAndHouse(cid) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, Configs.Messages.SALVED) setPlayerStorageValue(cid, Configs.Storage_Exhausted, os.time() + Configs.Exhausted) return true end Tag do talkactions.xml <talkaction words="/save;!save" event="script" value="SavePlayers.lua"/>
  7. local cf = { teleportPosition = {x = 167, y = 49, z = 7, stackpos = 1}, -- Where the teleport will be created teleportToPosition = {x = 540, y = 665, z = 7}, -- Where the teleport will take you from = {x=508,y=641,z=7}, -- left top corner of event room to = {x=575,y=691,z=7} -- right bottom corner of event room } local function LoopEffectInTeleport(Position) local Teleport = getTileItemById(Position, 1387).uid if Teleport > 0 then doSendMagicEffect(Position, 55) doSendMagicEffect(Position, 56) addEvent(LoopEffectInTeleport, 5 * 1000) end end function onTime() doItemSetAttribute(doCreateTeleport(1387, cf.teleportToPosition, cf.teleportPosition), "aid", 1747) doBroadcastMessage("FireStorm event starting in 3 minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) LoopEffectInTeleport(cf.teleportToPosition) setGlobalStorageValue(17, 0) addEvent(startEventF, 3 * 60 * 1000) return true end function startEventF () doRemoveItem(getTileItemById(cf.teleportPosition, 1387).uid, 1) if getGlobalStorageValue(17) > 0 then addEvent(doRepeatCheckFireStorm, 5 * 1000) doBroadcastMessage("Good luck in the FireStorm event people! The teleport has closed!", MESSAGE_STATUS_WARNING) else doBroadcastMessage('FireStorm Event hasn\'t started beacuse there were not enough players.') end end y, x = 1, 1 function doRepeatCheckFireStorm () if getGlobalStorageValue(17) > 0 then local xTable, yTable, playerTable = {}, {}, {} for x = cf.from.x, cf.to.x do for y = cf.from.y, cf.to.y do table.insert(xTable, x) table.insert(yTable, y) local n, i = getTileInfo({x=x, y=y, z=cf.to.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=cf.to.z, stackpos=i}).uid while v ~= 0 do if isPlayer(v) then table.insert(playerTable, v) if n == #playerTable then break end end i = i + 1 v = getThingfromPos({x=x, y=y, z=cf.to.z, stackpos=i}).uid end end end end if #playerTable == 1 then doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true) doItemSetAttribute(doPlayerAddItem(playerTable[1], 7371), "name", "trophy " .. getCreatureName(playerTable[1]) .. "! Congratulations! Winner a fire event") doPlayerAddItem(playerTable[1],9971,2) doPlayerAddItem(playerTable[1],10559,15) doBroadcastMessage('FireStorm Event has finished. The winner is ' .. getCreatureName(playerTable[1]) .. '. Congratulations.') setGlobalStorageValue(17, 0) x, y = 1, 1 elseif #playerTable > 1 then for a = 1, y do local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7} for _, player in ipairs(playerTable) do local pPos = getThingPos(player) if pPos.x == pos.x and pPos.y == pos.y and pPos.z == pos.z then doTeleportThing(player, getTownTemplePosition(getPlayerTown(playerTable[1])), true) end end doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) math.random(100,1000) end if x == 5 * y then y = y + 1 end x = x + 1 else doBroadcastMessage('No one have won in Fire Storm Event.') setGlobalStorageValue(17, 0) x, y = 1, 1 end addEvent(doRepeatCheckFireStorm, 1000) end end Testa ai.
  8. Os efeitos é só pra quando o evento estiver aberto correto?
  9. Não deve ser problema no script e sim nas configurações da TownID da house, do player ou do depot que você está abrindo.
  10. Script LeverHunt.lua local Configs = { Item_Necessary_ID = 2131, Item_Necessary_Count = 1, Enter = { {x = 159, y = 386, z = 6}, {x = 160, y = 386, z = 6}, {x = 161, y = 386, z = 6}, {x = 162, y = 386, z = 6} }, Exit_Position = {x = 160, y = 390, z = 6} } local function checkPlayersInTile() local Players = {} for i = 1, #Configs.Enter do local pid = getTopCreature(Configs.Enter[i]).uid if isPlayer(pid) and getPlayerItemCount(pid, Configs.Item_Necessary_ID) >= Configs.Item_Necessary_Count then table.insert(Players, pid) end end return Players end function onUse(cid, item, fromPosition, itemEx, toPosition) if #checkPlayersInTile() == 4 then for i, pid in pairs(checkPlayersInTile()) do doTeleportThing(pid, Configs.Exit_Position) doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Ops, não tem 4 players.") end return true end Tag: <action actionid="2001" event="script" value="LeverHunt.lua"/>
  11. Dento do script fechazombie.lua no globalevents pesquise por: function onTimer() e altere por: function onTime()
  12. Explica direito oque você quer, isso que criei é somente pra setar storage.

Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia partindo do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer publicidade para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução! A publicação do seu anuncio é instantânea!

×