Histórico de Curtidas
-
Danyel Varejao recebeu reputação de b3499063 em [System] Auto Loot Perfect~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7
Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa.
1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo:
2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione:
3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
5° - Em data/actions/actions.xml adicione a seguinte tag:
<!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost.
6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:
<!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag:
<!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/>
Créditos
50% Killua(Vitor Bertolucci)
50% Danyel Varejão
-
Danyel Varejao recebeu reputação de Lincoln123123 em [System] Auto Loot Perfect~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7
Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa.
1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo:
2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione:
3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
5° - Em data/actions/actions.xml adicione a seguinte tag:
<!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost.
6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:
<!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag:
<!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/>
Créditos
50% Killua(Vitor Bertolucci)
50% Danyel Varejão
-
Danyel Varejao recebeu reputação de Balkalima em [System] Auto Loot Perfect~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7
Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa.
1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo:
2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione:
3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
5° - Em data/actions/actions.xml adicione a seguinte tag:
<!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost.
6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:
<!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag:
<!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/>
Créditos
50% Killua(Vitor Bertolucci)
50% Danyel Varejão
-
Danyel Varejao recebeu reputação de Fir3element em (Resolvido)ERRO GRAVISSIMOSubstitua para essa:
Cylinder* Player::__queryDestination(int32_t& index, const Thing* thing, Item** destItem, uint32_t& flags) { if(!index /*drop to capacity window*/ || index == INDEX_WHEREEVER) { *destItem = NULL; const Item* item = thing->getItem(); if(!item) return this; std::list<std::pair<Container*, int32_t> > containers; std::list<std::pair<Cylinder*, int32_t> > freeSlots; bool autoStack = !((flags & FLAG_IGNOREAUTOSTACK) == FLAG_IGNOREAUTOSTACK); for(int32_t i = SLOT_FIRST; i < SLOT_LAST; ++i) { if(Item* invItem = inventory[i]) { if(invItem == item || invItem == tradeItem) continue; if(autoStack && item->isStackable() && __queryAdd(i, item, item->getItemCount(), 0) == RET_NOERROR && invItem->getID() == item->getID() && invItem->getItemCount() < 100) { *destItem = invItem; index = i; return this; } if(Container* container = invItem->getContainer()) { if(!autoStack && container->__queryAdd(INDEX_WHEREEVER, item, item->getItemCount(), flags) == RET_NOERROR) { index = INDEX_WHEREEVER; return container; } containers.push_back(std::make_pair(container, 0)); } } else if(!autoStack) { if(__queryAdd(i, item, item->getItemCount(), 0) == RET_NOERROR) { index = i; return this; } } else freeSlots.push_back(std::make_pair(this, i)); } while(!containers.empty()) { Container* tmpContainer = containers.front().first; int32_t level = containers.front().second; containers.pop_front(); if(!tmpContainer) continue; for(uint32_t n = 0; n < tmpContainer->capacity(); ++n) { if(Item* tmpItem = tmpContainer->getItem(n)) { if(tmpItem == item || tmpItem == tradeItem) continue; if(autoStack && item->isStackable() && tmpContainer->__queryAdd(n, item, item->getItemCount(), 0) == RET_NOERROR && tmpItem->getID() == item->getID() && tmpItem->getItemCount() < 100) { index = n; *destItem = tmpItem; return tmpContainer; } if(Container* container = tmpItem->getContainer()) { if(!autoStack && container->__queryAdd(INDEX_WHEREEVER, item, item->getItemCount(), flags) == RET_NOERROR) { index = INDEX_WHEREEVER; return container; } containers.push_back(std::make_pair(container, level + 1)); } } else { if(!autoStack) { if(tmpContainer->__queryAdd(n, item, item->getItemCount(), 0) == RET_NOERROR) { index = n; return tmpContainer; } } else freeSlots.push_back(std::make_pair(tmpContainer, n)); break; // one slot to check is definitely enough. } } } if(autoStack) { while(!freeSlots.empty()) { Cylinder* tmpCylinder = freeSlots.front().first; int32_t i = freeSlots.front().second; freeSlots.pop_front(); if(!tmpCylinder) continue; if(tmpCylinder->__queryAdd(i, item, item->getItemCount(), flags) == RET_NOERROR) { index = i; return tmpCylinder; } } } return this; } Thing* destThing = __getThing(index); if(destThing) *destItem = destThing->getItem(); if(Cylinder* subCylinder = dynamic_cast<Cylinder*>(destThing)) { index = INDEX_WHEREEVER; *destItem = NULL; return subCylinder; } return this; } Seu problema era uma configuração no config.lua de máximo de backpacks que iriam achar.
Foi removido as linhas:
int32_t deepness = g_config.getNumber(ConfigManager::PLAYER_DEEPNESS); if(deepness < 0 || level < deepness) containers.push_back(std::make_pair(container, level + 1));
-
Danyel Varejao recebeu reputação de bielfaisca em (Resolvido)ERRO GRAVISSIMOSubstitua para essa:
Cylinder* Player::__queryDestination(int32_t& index, const Thing* thing, Item** destItem, uint32_t& flags) { if(!index /*drop to capacity window*/ || index == INDEX_WHEREEVER) { *destItem = NULL; const Item* item = thing->getItem(); if(!item) return this; std::list<std::pair<Container*, int32_t> > containers; std::list<std::pair<Cylinder*, int32_t> > freeSlots; bool autoStack = !((flags & FLAG_IGNOREAUTOSTACK) == FLAG_IGNOREAUTOSTACK); for(int32_t i = SLOT_FIRST; i < SLOT_LAST; ++i) { if(Item* invItem = inventory[i]) { if(invItem == item || invItem == tradeItem) continue; if(autoStack && item->isStackable() && __queryAdd(i, item, item->getItemCount(), 0) == RET_NOERROR && invItem->getID() == item->getID() && invItem->getItemCount() < 100) { *destItem = invItem; index = i; return this; } if(Container* container = invItem->getContainer()) { if(!autoStack && container->__queryAdd(INDEX_WHEREEVER, item, item->getItemCount(), flags) == RET_NOERROR) { index = INDEX_WHEREEVER; return container; } containers.push_back(std::make_pair(container, 0)); } } else if(!autoStack) { if(__queryAdd(i, item, item->getItemCount(), 0) == RET_NOERROR) { index = i; return this; } } else freeSlots.push_back(std::make_pair(this, i)); } while(!containers.empty()) { Container* tmpContainer = containers.front().first; int32_t level = containers.front().second; containers.pop_front(); if(!tmpContainer) continue; for(uint32_t n = 0; n < tmpContainer->capacity(); ++n) { if(Item* tmpItem = tmpContainer->getItem(n)) { if(tmpItem == item || tmpItem == tradeItem) continue; if(autoStack && item->isStackable() && tmpContainer->__queryAdd(n, item, item->getItemCount(), 0) == RET_NOERROR && tmpItem->getID() == item->getID() && tmpItem->getItemCount() < 100) { index = n; *destItem = tmpItem; return tmpContainer; } if(Container* container = tmpItem->getContainer()) { if(!autoStack && container->__queryAdd(INDEX_WHEREEVER, item, item->getItemCount(), flags) == RET_NOERROR) { index = INDEX_WHEREEVER; return container; } containers.push_back(std::make_pair(container, level + 1)); } } else { if(!autoStack) { if(tmpContainer->__queryAdd(n, item, item->getItemCount(), 0) == RET_NOERROR) { index = n; return tmpContainer; } } else freeSlots.push_back(std::make_pair(tmpContainer, n)); break; // one slot to check is definitely enough. } } } if(autoStack) { while(!freeSlots.empty()) { Cylinder* tmpCylinder = freeSlots.front().first; int32_t i = freeSlots.front().second; freeSlots.pop_front(); if(!tmpCylinder) continue; if(tmpCylinder->__queryAdd(i, item, item->getItemCount(), flags) == RET_NOERROR) { index = i; return tmpCylinder; } } } return this; } Thing* destThing = __getThing(index); if(destThing) *destItem = destThing->getItem(); if(Cylinder* subCylinder = dynamic_cast<Cylinder*>(destThing)) { index = INDEX_WHEREEVER; *destItem = NULL; return subCylinder; } return this; } Seu problema era uma configuração no config.lua de máximo de backpacks que iriam achar.
Foi removido as linhas:
int32_t deepness = g_config.getNumber(ConfigManager::PLAYER_DEEPNESS); if(deepness < 0 || level < deepness) containers.push_back(std::make_pair(container, level + 1));
-
Danyel Varejao recebeu reputação de Cricket em Save player and HouseFala 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"/>
-
Danyel Varejao deu reputação a Lyu em Cam System 10.98 (TFS 1.3)Olá TK, hoje venho publicar um sistema bem interessante que venho mexendo há algumas semanas, estou falando do Cam System, um sistema de nível avançado que coleta packets durante a jogatina e forma uma gravação daquele momento, onde você poderá assistir à essa gravação quantas vezes quiser, como um replay, porém o sistema está limitado somente para fins de estudos e curiosidades. Não recomendo utilizar em seu servidor, pois como está limitado, também está rodando dentro do TFS e pode pesar, já que não tive tempo para otimizá-lo e criar um server próprio somente para assistir às gravações. Também não está serializando/deserializando em arquivos.cam, está salvando na memória. Mais uma vez, não utilize, só estude a principal funcionalidade do sistema.
Bom, o gist já está publicado, você pode acessá-lo aqui ou então baixar a source já com o sistema incluso pronto pra rodar (Lembrando que utilizei a última versão do forgottenserver-master, confira aqui)
Download da Source: src with cam.zip
Scan: https://www.virustotal.com/gui/file/3392c1c31d8bbab5cdc2f7e3c0c766749f3238efd2c36c80575480283b15fc32/detection
Para começar uma nova gravação, utilize /replay start
Para parar uma gravação e salvá-la, utilize /replay stop
feito isso, para assisti-la, deslogue sua conta e na janela de login, deixe o accountname vazio e no password informe replaylist
Então é isso, se algum Programador estiver afim de aplicar otimizações/serialização ao sistema, fique à vontade para contribuir. Este sistema é incrível e pode muito bem dar certo. ?
Vídeo de demonstração:
-
Danyel Varejao recebeu reputação de Rayo em (Resolvido)[Erro] função creature:moveTo@Rayo o erro apresentado é que você não possui a função creature:moveTo(pos) em sua source, verifique se seguiu o tutorial corretamente e compilou sua source.
-
Danyel Varejao recebeu reputação de brenner44 em [System] Auto Loot Perfect~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7
Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa.
1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo:
2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione:
3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
5° - Em data/actions/actions.xml adicione a seguinte tag:
<!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost.
6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:
<!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag:
<!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/>
Créditos
50% Killua(Vitor Bertolucci)
50% Danyel Varejão
-
Danyel Varejao recebeu reputação de Pedro. em [System] Auto Loot Perfect~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7
Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa.
1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo:
2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione:
3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
5° - Em data/actions/actions.xml adicione a seguinte tag:
<!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost.
6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:
<!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag:
<!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/>
Créditos
50% Killua(Vitor Bertolucci)
50% Danyel Varejão
-
Danyel Varejao recebeu reputação de Zabim em Ajuda com script da annihilatorlocal room = { -- room with demons fromX = 33229, fromY = 31697, fromZ = 14, toX = 33224, toY = 31697, toZ = 14 } local monster_pos = { [1] = {pos = {33224, 31695, 14}, monster = "Demon"}, [2] = {pos = {33226, 31695, 14}, monster = "Demon"}, [3] = {pos = {33228, 31697, 14}, monster = "Demon"}, [4] = {pos = {33229, 31697, 14}, monster = "Demon"}, [5] = {pos = {33227, 31699, 14}, monster = "Demon"}, [6] = {pos = {33225, 31699, 14}, monster = "Demon"} } local monster_area = { area = { topLeftPos = {x = 33224, y = 31695, z = 14}, bottomRightPos = {x = 33250, y = 31750, z = 12}, }, monsters = { {name = "Fire Elemental", count = 5}, {name = "Hellfire Fighter", count = 2}, } } local players_pos = { {x = 33224, y =31671, z = 13, stackpos = 253}, {x = 33223, y =31671, z = 13, stackpos = 253}, {x = 33222, y =31671, z = 13, stackpos = 253}, {x = 33221, y =31671, z = 13, stackpos = 253} } local new_player_pos = { {x = 33227, y = 31697, z = 14}, {x = 33226, y = 31697, z = 14}, {x = 33225, y = 31697, z = 14}, {x = 33224, y = 31697, z = 14} } local playersOnly = "no" local questLevel = 101 function onUse(cid, item, fromPosition, itemEx, toPosition) local all_ready, monsters, player, level = 0, 0, {}, 0 if item.itemid == 1945 then for i = 1, #players_pos do table.insert(player, 0) end for i = 1, #players_pos do player = getThingfromPos(players_pos) if player.itemid > 0 then if string.lower(playersOnly) == "yes" then if isPlayer(player.uid) == TRUE then all_ready = all_ready+1 else monsters = monsters+1 end else all_ready = all_ready+1 end end end if all_ready == #players_pos then for i = 1, #players_pos do player = getThingfromPos(players_pos) if isPlayer(player.uid) == TRUE then if getPlayerLevel(player.uid) >= questLevel then level = level+1 end else level = level+1 end end if level == #players_pos then if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then for _, area in pairs(monster_pos) do doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]}) end for i = 1, #monster_area.monsters do local PosX = math.random(monster_area.area.topLeftPos.x, monster_area.area.bottomRightPos.x) local PosY = math.random(monster_area.area.topLeftPos.y, monster_area.area.bottomRightPos.y) local PosZ = monster_area.area.topLeftPos.z local position = {x = PosX, y = PosY, z = PosZ} for k = 1, monster_area.monsters[i].count do doSummonCreature(monster_area.monsters[i].name, position, false, true) end end for i = 1, #players_pos do doSendMagicEffect(players_pos, CONST_ME_POFF) doTeleportThing(player.uid, new_player_pos, FALSE) doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA) doTransformItem(item.uid,1946) end else doPlayerSendTextMessage(cid,19,"Only players can do this quest.") end else doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.") end else doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.") end elseif item.itemid == 1946 then local player_room = 0 for x = room.fromX, room.toX do for y = room.fromY, room.toY do for z = room.fromZ, room.toZ do local pos = {x=x, y=y, z=z,stackpos = 253} local thing = getThingfromPos(pos) if thing.itemid > 0 then if isPlayer(thing.uid) == TRUE then player_room = player_room+1 end end end end end if player_room >= 1 then doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.") elseif player_room == 0 then for x = room.fromX, room.toX do for y = room.fromY, room.toY do for z = room.fromZ, room.toZ do local pos = {x=x, y=y, z=z,stackpos = 253} local thing = getThingfromPos(pos) if thing.itemid > 0 then doRemoveCreature(thing.uid) end end end end doTransformItem(item.uid,1945) end end return TRUE end
-
Danyel Varejao recebeu reputação de poko360 em (Resolvido)[Creaturescript] Como travar um player se tiver tal storage?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.
-
Danyel Varejao recebeu reputação de FiNub em Auto Loot PerfectTroca 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
-
Danyel Varejao recebeu reputação de Vodkart em Save player and HouseFala 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"/>
-
Danyel Varejao recebeu reputação de theeusata55 em (Resolvido)Anunciando eventolocal 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.
-
Danyel Varejao recebeu reputação de Deathstroke em [System] Auto Loot Perfect~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7
Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa.
1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo:
2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione:
3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
5° - Em data/actions/actions.xml adicione a seguinte tag:
<!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost.
6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:
<!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag:
<!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/>
Créditos
50% Killua(Vitor Bertolucci)
50% Danyel Varejão
-
Danyel Varejao recebeu reputação de Killernaldita em [System] Auto Loot Perfect~~~~~ * Auto Loot System 100% * ~~~~~ TFS 0.4 / TFS 0.3.7
Fala galerinha do Tibiaking, então, várias pessoas estão tendo problema com o sistema de autoloot, aqui vai um sistema que eu editei para melhorar o uso do mesmo. Sem muita enrolação vamos ao que interessa.
1° - Acesse a pasta data/lib e crie um arquivo chamado Auto_Loot.lua, coloque isso dentro do arquivo:
2° - Abra a pasta data/actions/scripts e crie um arquivo chamado Auto_Loot_Boost.lua, dentro dele adicione:
3° - Abra a pasta data/creaturescripts/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
4° - Abra a pasta data/talkactions/scripts e crie um arquivo chamado Auto_Loot.lua, dentro dele adicione:
5° - Em data/actions/actions.xml adicione a seguinte tag:
<!-- Auto Loot --> <action itemid="7443" event="script" value="Auto_Loot_Boost.lua"/> Altere o numero 7443 caso queira mudar o id do item do seu auto loot boost.
6° - Em data/creaturescripts/creaturescripts.xml adicione a seguinte tag:
<!-- Auto Loot --> <event type="login" name="Auto_Loot_Login" event="script" value="Auto_Loot.lua"/> <event type="kill" name="Auto_Loot_Kill" event="script" value="Auto_Loot.lua"/> 7° - Em data/talkactions/talkactions.xml adicione a seguinte tag:
<!-- Auto Loot --> <talkaction access="0-4" words="/autoloot;!autoloot" event="script" value="Auto_Loot.lua"/>
Créditos
50% Killua(Vitor Bertolucci)
50% Danyel Varejão
-
Danyel Varejao recebeu reputação de irvanovitch em Save player and HouseFala 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"/>
-
Danyel Varejao deu reputação a KotZletY em Save player and House@Tópico aprovado e movido para área correta!!
-
Danyel Varejao deu reputação a Natanael Beckman em Save player and HouseCaraca isso é muito útil e já estou usando em meu servidor, obrigado mano!
-
Danyel Varejao deu reputação a Cat em Save player and HouseMuito bom esse script, obrigado mano.
-
Danyel Varejao recebeu reputação de Biinhow em Save player and HouseFala 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"/>
-
Danyel Varejao recebeu reputação de luanluciano93 em Save player and HouseFala 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"/>
-
Danyel Varejao recebeu reputação de Fir3element em Save player and HouseFala 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"/>
-
Danyel Varejao recebeu reputação de Cat em Save player and HouseFala 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"/>