Search the Community
Showing results for tags 'action'.
-
Visto que agora e aonda do tfs 1.2 vou trazer umas paradas do forum gringo. E como não vi no forum, acho que e bizu. Addon doll e Mount Doll por Modal Window... é fácil e simples. Primeiro vamos precisar instalar o modal window. va em data/lib/lib.lua e adiciona: dofile('data/lib/modalwindow.lua') Depois na pasta data/Lib crie um arquivo chamado modalwindow e adiciona esse code. Agora em data/creaturescripts/creaturescripts.xml Add a tag. <event type="modalwindow" name="ModalWindowHelper" script="modalwindowhelper.lua" /> Agora crie um arquivo chamado modalwindowhelper. e add o code nele. Pronto a parte da janela esta feita, agora vamos ao Addon em actions.xml add. <action itemid="ITEMID" script="addon_doll.lua"/> em item id coloque o id que desejar, depois disso crie um arquivo chamado de addon_doll.lua e add. em global.lua add dofile('data/lib/addon_doll.lua') para finalizar cria um arquivo em /data/lib/ com o nome de addon_doll.lua e add o code. Pronto Addon Doll Finalizado vamos ao Mount.... No arquivo /data/actions/actions.xml add. <action itemid="ITEMID" script="mount_doll.lua"/> Agora em /data/actions/scripts crie um arquivo com o nome mount_doll.lua e add. Agora no arquivo data/global.xml add. dofile('data/lib/mount_doll.lua') agora em /data/lib/ crie um arquivo com o nome "mount_doll.lua" e add. Pronto codigo finalizado. Espero que seja útil, lembrando não foi eu quem fiz, mais qualquer duvida e so falar que tento ajudar. foi o membro Strutz de um fórum gringo. Créditos todo dele.
-
Oi. Vim trazer esse sistema postado por nosso amigo zbizu da comunidade otland. Se não sabe como funciona, veja o exemplo abaixo. Espero que seja útil! 07:39 You see a mastermind shield (Def:37). It weighs 57.00 oz. [shield.+5%] [mp.+10%] [melee.+2%] 07:40 You see a crossbow (Range:5). It weighs 40.00 oz. [shield.+2%] [mp.+14%] [hp.+4%] SLOT SYSTEM global.lua function getItemAttack(uid) return ItemType(getThing(uid).itemid):getAttack() end function getItemDefense(uid) return ItemType(getThing(uid).itemid):getDefense() end function getItemArmor(uid) return ItemType(getThing(uid).itemid):getArmor() end function getItemWeaponType(uid) return ItemType(getThing(uid).itemid):getWeaponType() end function isArmor(uid) if (getItemArmor(uid) ~= 0 and getItemWeaponType(uid) == 0) then return true else return false end end function isWeapon(uid) return (getItemWeaponType(uid) > 0 and getItemWeaponType(uid) ~= 4) end function isShield(uid) return getItemWeaponType(uid) == 4 end function isBow(uid) return (getItemWeaponType(uid) == 5 and (not ItemType(getThing(uid).itemid):isStackable())) end actions.xml <action itemid="8300" script="slot.lua"/> slot.lua action local conf = {maxSlotCount=3,ignoredIds={}}function choose(...) local arg = {...} return arg[math.random(1,#arg)]endfunction onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid == 0 or item.itemid == 0 then return false end toPosition.stackpos = 255 if isInArray(conf.ignoredIds, itemEx.itemid) or isItemStackable(itemEx.uid) or itemEx.itemid == 0 or itemEx.type > 1 or not(isArmor(itemEx.uid) or isWeapon(itemEx.uid) or isShield(itemEx.uid)) then return false end if isCreature(itemEx.uid) then return false end local nam = Item(itemEx.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) function getper() local n = 1 for i=1,10 do n = n+math.random(0,10) if n < 8*i then break end end return n end function getSlotCount(nam) local c = 0 for _ in nam:gmatch('%[(.-)%]') do c = c+1 end return c end if getSlotCount(nam) < conf.maxSlotCount then local l = choose('hp','mp','ml','melee','shield','dist') local p = getper() doSendMagicEffect(toPosition,30) nam = nam..' ['..l..'.+'..p..'%]' doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,l..'.+'..p..'%') doSetItemSpecialDescription(itemEx.uid, nam) doRemoveItem(item.uid,1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Slot limit reached.") end return trueend creaturescripts.xml <event type="login" name="SlotLogin" script="slot.lua"/> slot.lua creaturescripts local conditionMP,conditionHP,conditionML,conditionCLUB,conditionSHI,conditionDIST,conditionAMP = {},{},{},{},{},{},{}for i=1,300 do conditionHP[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionHP[i], CONDITION_PARAM_SUBID, 50) setConditionParam(conditionHP[i], CONDITION_PARAM_BUFF_SPELL, 1) setConditionParam(conditionHP[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionHP[i], CONDITION_PARAM_STAT_MAXHITPOINTSPERCENT, 100+i) conditionMP[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionMP[i], CONDITION_PARAM_SUBID, 51) setConditionParam(conditionMP[i], CONDITION_PARAM_BUFF_SPELL, 1) setConditionParam(conditionMP[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionMP[i], CONDITION_PARAM_STAT_MAXMANAPOINTSPERCENT, 100+i) conditionML[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionML[i], CONDITION_PARAM_SUBID, 52) setConditionParam(conditionML[i], CONDITION_PARAM_BUFF_SPELL, 1) setConditionParam(conditionML[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionML[i], CONDITION_PARAM_STAT_MAGICPOINTSPERCENT, 100+i) conditionCLUB[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SUBID, 53) setConditionParam(conditionCLUB[i], CONDITION_PARAM_BUFF_SPELL, 1) setConditionParam(conditionCLUB[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionCLUB[i], CONDITION_PARAM_SKILL_MELEEPERCENT, 100+i) conditionSHI[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionSHI[i], CONDITION_PARAM_SUBID, 54) setConditionParam(conditionSHI[i], CONDITION_PARAM_BUFF_SPELL, 1) setConditionParam(conditionSHI[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionSHI[i], CONDITION_PARAM_SKILL_SHIELDPERCENT, 100+i) conditionDIST[i] = createConditionObject(CONDITION_ATTRIBUTES) setConditionParam(conditionDIST[i], CONDITION_PARAM_SUBID, 55) setConditionParam(conditionDIST[i], CONDITION_PARAM_BUFF_SPELL, 1) setConditionParam(conditionDIST[i], CONDITION_PARAM_TICKS, -1) setConditionParam(conditionDIST[i], CONDITION_PARAM_SKILL_DISTANCEPERCENT, 100+i)endfunction getSlotType(n) if not n then return false end if n:match('%[(.+)%]') then n = n:match('%[(.+)%]') if n == '?' then return 0,n else return n:match('(.-)%.([+-])(%d+)%%') end else return false endendlocal function loadSet(cid)local player = Player(cid)if not player then return false end local t = {} for slot=1,9 do t[slot] = '' local s = getPlayerSlotItem(player,slot).uid if s ~= 0 then t[slot] = Item(s):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) end end return tendfunction chk(cid,f) if not Player(cid) then return false end local t = loadSet(cid) if not t then return false end for i=1,#f do if f[i] ~= t[i] then equip(player,nil,slot) break end end addEvent(chk,2000,cid,t)endfunction check_slot(aab, i) if i == 5 or i == 6 then if isWeapon(aab) or isShield(aab) or isBow(aab) then return true end else return true endreturn falseendfunction equip(player,item,slot) local t = {} if item then local mm,sinal,qto = getSlotType(Item(item.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION)) t[mm] = tonumber(qto) end for i=1,9 do if i ~= slot then if getPlayerSlotItem(player,i).itemid ~= 0 then local aab = getPlayerSlotItem(player,i).uid if aab and check_slot(aab,i) then for _ in Item(aab):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION):gmatch('(%[.-%])') do local mm,sinal,qto2 = getSlotType(_) if mm then if not t[mm] then t[mm] = 0 end t[mm] = t[mm]+tonumber(qto2) t[mm] = t[mm] > 300 and 300 or t[mm] end end end end end end local fu = 0 local ca = {} local s = '' for sl,n in pairs(t) do fu = fu+1 s = s..''..n..'% more of '..sl..'\n' if sl == 'hp' then player:addCondition(conditionHP[tonumber(n)]) ca[50] = 1 doSendTutorial(player,19) elseif sl == 'mp' then player:addCondition(conditionMP[tonumber(n)]) ca[51] = 1 doSendTutorial(player,19) elseif sl == 'ml' then player:addCondition(conditionML[tonumber(n)]) ca[52] = 1 elseif sl == 'melee' then player:addCondition(conditionCLUB[tonumber(n)]) ca[53] = 1 elseif sl == 'shield' then player:addCondition(conditionSHI[tonumber(n)]) ca[54] = 1 elseif sl == 'dist' then player:addCondition(conditionDIST[tonumber(n)]) ca[55] = 1 end end if fu > 0 then for i=50,55 do if not ca[i] then doRemoveCondition(player:getId(),CONDITION_ATTRIBUTES,i) end end else for i=50,55 do doRemoveCondition(player:getId(),CONDITION_ATTRIBUTES,i) end end return trueendfunction onLogin(player) equip(player,nil,slot)local cid = player:getId() addEvent(chk,2000,cid,loadSet(cid)) return trueend SLOT REMOVER actions.xml <action itemid="8299" script="slotremove.lua"/> slotremove.lua function getSlotType_full(n) if not n then return false end if n:match('%[(.+)%]') then n = n:match('%[(.+)%]') if n == '?' then return 0,n else return n end else return false endendfunction onUse(cid, item, fromPosition, itemEx, toPosition)item_slots_a = 0item_slots_n = ""item_slots_t = {} for _ in Item(itemEx.uid):getAttribute(ITEM_ATTRIBUTE_DESCRIPTION):gmatch('(%[.-%])') do item_slots_a = item_slots_a + 1 item_slots_t[item_slots_a] = getSlotType_full(_) end if item_slots_t[1] == nil then return false end for i = 1, #item_slots_t - 1 do item_slots_n = item_slots_n .. "[" .. item_slots_t[i] .. "]" end doRemoveItem(item.uid,1) doSendMagicEffect(toPosition,CONST_ME_MAGIC_RED) doSetItemSpecialDescription(itemEx.uid, item_slots_n) doPlayerSendTextMessage(cid,20,"Attribute removed.")return trueend
-
- slot system
- tfs 1.1
-
(and 2 more)
Tagged with:
-
Fala galera, vim compartilhar com vcs um dos sistemas que eu fiz baseado no jogo Bird Hunt e que foi imbutido em alguns servidores famosos, sendo o Korelin um deles. Obs: Testado em TFS 0.3.6 mas deve funcionar em TFS 0.4 sem problema aqui tem uma pequena imagem demonstrando o sistema sendo utilizado: Bom, antes de tudo eu vou ensinar vocês a criar um mapa apropriado pois isso é 90% das dificuldades que os players enfrentam quando tentam adicionar o sistema. Inicialmente vc vai precisar criar uma area no seu mapa editor +- parecida com a que eu fiz na imagem abaixo: Feito isso vc deverá colocar uniqueid 16480 na porta e actionid 14874 em todos os lugares que o player pode percorrer (da placa pra \/ todos os quadrados verdes deverão conter esse actionid) Colocado os ids, vc deverá fazer a sala à prova de bugs, para isso você terá que seguir essas especificações: Note que em verde são os lugares que vc deverá colocar protect zone e em roxo os locais onde vc deve colocar no logout zone. Agora perceba que nas posições onde o player irá andar, você vai colocar tanto no logout zone como protect zone, isso pra evitar ele de matar o bixo com spells e pra evitar que ele deslogue durante o mini game. Essa contagem de sqms eu vou explicar mais tarde na configuração do script, mas tenham ela em mente. Agora vamos aos scripts: Comece criando em data/lib um arquivo chamado 045- Bird Hunt Lib.lua e colocando isso dentro dele: Feito isso vá em data/actions/scripts e adicione um arquivo chamado seagul.lua que deverá conter: e adicione em actions.xml: <action uniqueid="16480" event="script" value="seagul.lua"/> Agora vá em data/movements/scripts e crie um arquivo chamado seagulmove.lua com o seguinte conteúdo: E adicione as tags em movements.xml: <movevent type="StepIn" actionid="14872" event="script" value="seagulmove.lua"/> <movevent type="StepOut" actionid="14872" event="script" value="seagulmove.lua"/> Agora, pra deixar nosso sistema mais real e difícil, altere a velocidade do seagul de 200 pra 300 na pasta data/monsters/Birds/seagull.xml eu alterei tb a quantidade de vida q ele começa a fugir pra vida atual dele e fiz outras alterações pra tornar mais difícil, mas isso é com vcs. A maioria das coisas tá bem compreensível, com exceção das duas primeiras linhas de actions: rangecima = {x = -8, y = -4}, -- distancia em x e y da topos (ate a pos de cima) rangebaixo = {x = 0, y = 4}, -- distancia em x e y da topos (ate a pos de baixo) é aqui que entra aquela imagem, vc vai considerar a porta (o ponto cinza) como sendo nossa origem, ou seja, o ponto (0,0) rangecima é a distancia que eu tenho que percorrer em x e y pra chegar até a ponta de cima < e rangebaixo é a distancia que eu tenho que percorrer em x e y pra chegar até a ponta de baixo. Se vcs mudarem o tamanho da sala, fiquem ligados nisso. Obs: algumas pessoas fazem a sala virada pra direita também, nesse caso vc mantém a actions (pode usar inclusive o mesmo arquivo), só tem que alterar o movements pois lá vc define se é direita ou esquerda. É isso, espero que tenham gostado. O jogo é só por diversão mas vc pode alterar a função de atirar pra ganhar dinheiro por cada acerto ou então criar um npc que vc te dá X premio dependendo do seu recorde.. podendo esse premio inclusive ser uma key pra uma quest. Usem a imaginação e espero que aproveitem esse sistema. Abraços do Lobo.
-
Olá, vim trazer à comunidade esse código. Ele permite adicionar tempo para resetar a dh quest. Ele foi postado originalmente pelo membro Lundrial, da otland. Bem, não há mais o que dizer. DH LEVER TIME lever.lua local timetoreset = 5 -- Time to reset the quest in minutes.local objectid = xxxx -- Id of the item Blocking the pathlocal p = { Position(x, y, z), -- Position of the item blocking the path Position(x, y, z), -- Teleport Creation position Position(x, y, z) -- Position where it sends you}function onUse(cid, item, fromPosition, itemEx, toPosition, isHotkey) local stone = Tile(p[1]) local tp = Tile(p[2]) if item.itemid == 1945 then cid:sendTextMessage(MESSAGE_EVENT_ORANGE, 'The object in your path has been removed for ' .. timetoreset .. ' minutes.') doCreateTeleport(1387, p[3], p[2]) stone:getItemById(objectid):remove() p[1]:sendMagicEffect(CONST_ME_POFF) p[2]:sendMagicEffect(CONST_ME_TELEPORT) Item(item.uid):transform(1946) addEvent(function(stonePos) Game.createItem(objectid, 1, stonePos) stonePos:sendMagicEffect(CONST_ME_TELEPORT) p[2]:sendMagicEffect(CONST_ME_POFF) tp:getItemById(1387):remove() Tile(toPosition):getItemById(1946):transform(1945) end, timetoreset * 60000, stone:getPosition()) elseif item.itemid == 1946 then return false end return trueend
- 1 reply
-
- demon helmet
- dh quest
-
(and 3 more)
Tagged with:
-
Créditos totais à Kazuza. Versão: Testada somente na "10.31". (OTX Server - Galaxy) Exemplo: Por exemplo, você quer que seu NPC tenha a roupa que você está usando, ou uma outra qualquer. Porem você não quer perder tempo, então você digita: /outfit e irá aparecer no seu CHAT: <look type="128" head="117" body="5" legs="0" feet="116" addons="1" mount="0"/> Pronto, só copiar e colar no seu npc. Tutorial Data > TalkActions> Scripts, crie "Outfit.lua". OBS: Se tiver montaria use este: function onSay(cid, words, param) r = getCreatureOutfit(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '<look type="'..r.lookType..'" head="'..r.lookHead..'" body="'..r.lookBody..'" legs="'..r.lookLegs..'" feet="'..r.lookFeet..'" addons="'..r.lookAddons..'" mount="'..r.lookMount..'"/>') return true end Se não, use este: function onSay(cid, words, param) r = getCreatureOutfit(cid) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, '<look type="'..r.lookType..'" head="'..r.lookHead..'" body="'..r.lookBody..'" legs="'..r.lookLegs..'" feet="'..r.lookFeet..'" addons="'..r.lookAddons..'"/>') return true end "Data > TalkActions" em talkactions.xml adicione: <talkaction log="yes" group="4" access="3" words="/outfit" event="script" value="outfit.lua"/>
-
Demonstração O script consiste em fazer um minigame da Snake (lá do nokia, heheh). Quanto mais a "cobra" pegar os bolos/comida irá acrescentar mais e mais caixas/blocos ao seu "corpo". Instalação: snakesys.lua (data/lib) [EDITE DE ACORDO COM SEU SERVIDOR] Edite essas linhas em sua lib para combinar com o mapa: itemid=1860, freeglobalstorage=28103, -- se nao souber mexer, nao mexa itemFood=6394, controlpos= {x = 28, y = 198, z = 6}, -- posiçao onde o player vai ficar exitpos = {x = 36, y = 190, z = 7}, -- posiçao que o player vai sair centerpos= {x = 27, y = 197, z = 7}, -- posiçao central wallID = 1486, -- id da parede ao redor da arena interval = 300, -- velocidade no qual a cobra ira se mover Quatro pisos ao redor da posição de controle: local generated = { {x = 28, y = 197, z = 6}, {x = 29, y = 198, z = 6}, {x = 28, y = 199, z = 6}, {x = 27, y = 198, z = 6} } Primeiro piso: Segundo piso: actions.xml (data/actions) <action actionid="200" script="snake.lua"/> snake.lua (data/actions/scripts) function onUse(player, item, fromPosition, itemEx, toPosition) if (Game.getStorageValue(SNAKE.freeglobalstorage)) ~= 1 then player:teleportTo(SNAKE.controlpos) SNAKE.timer(player.uid,1,nil,1000) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Segure o CTRL e use as setas para controlar a cobra.') SNAKE.generateFood() else player:sendTextMessage(MESSAGE_EVENT_ADVANCE, 'Aguarde, por favor.') end end PS: Peguei de um fórum que estava em inglês e traduzi. PS²: É um script antigo porém funcional. Créditos: Mock the bear
-
Eae galeerrra xtibiana. Venho disponibilizar o famoso sistema de televisão poketibiano completo o sistema foi feito para ambos os clients tibianos. O sistema permite você assistir outro players jogando assim você fica sem usar itens,falar(so pm), se movimentar e etc... Vamos la: Vá em luascript.cpp e procure: int32_t LuaScriptInterface::luaGetTopCreature(lua_State* L) { //getTopCreature(pos) PositionEx pos; popPosition(L, pos); ScriptEnviroment* env = getEnv(); Tile* tile = g_game.getTile(pos); if(!tile) { pushThing(L, NULL, 0); return 1; } Thing* thing = tile->getTopCreature(); if(!thing || !thing->getCreature()) { pushThing(L, NULL, 0); return 1; } pushThing(L, thing, env->addThing(thing)); return 1; } E coloque embaixo: int32_t LuaScriptInterface::luaGetAllsTvs(lua_State* L) { //getAllsTvs(cid) ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(popNumber(L)); if (!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } Tvlist::iterator it; it = player->tv.begin(); lua_newtable(L); uint32_t tableplayers = 1; for(uint32_t i = 1; it != player->tv.end(); ++it, ++i) { Player* players = env->getPlayerByUID(*it); if (players) { lua_pushnumber(L, tableplayers); lua_pushnumber(L, env->addThing(players)); pushTable(L); tableplayers = tableplayers+1; } } return 1; } int32_t LuaScriptInterface::luaSetPlayerTv(lua_State* L) { ScriptEnviroment* env = getEnv(); Player* player_tv = env->getPlayerByUID(popNumber(L)); Creature* creature = env->getCreatureByUID(popNumber(L)); if (!creature) { errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); } Player* player = creature->getPlayer(); if (!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } if (!player_tv) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } player_tv->tv.push_back(player->getID()); SpectatorVec::iterator it; SpectatorVec list = g_game.getSpectators(player->getPosition()); Player* tmpPlayer = NULL; Condition* condition = NULL; if((condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_GAMEMASTER, -1, 0, false, GAMEMASTER_INVISIBLE))) { creature->setHideName(false); player->addCondition(condition); g_game.internalCreatureChangeVisible(creature, VISIBLE_GHOST_DISAPPEAR); for(it = list.begin(); it != list.end(); ++it) { if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->canSeeCreature(player)) tmpPlayer->sendMagicEffect(player->getPosition(), MAGIC_EFFECT_POFF); } for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit) { if(!pit->second->canSeeCreature(player)) pit->second->notifyLogOut(player); } IOLoginData::getInstance()->updateOnlineStatus(player->getGUID(), false); if(player->isTrading()) g_game.internalCloseTrade(player); player->clearPartyInvitations(); if(player->getParty()) player->getParty()->leave(player); g_game.internalTeleport(player, player_tv->getPosition(), true); } lua_pushboolean(L, true); } int32_t LuaScriptInterface::luaDoSendChannelsTv(lua_State* L) { ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(popNumber(L)); if (!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } player->sendChannelsDialog(true); lua_pushboolean(L, true); return 1; } int32_t LuaScriptInterface::luaDoRemovePlayerTv(lua_State* L) { ScriptEnviroment* env = getEnv(); Player* player = env->getPlayerByUID(popNumber(L)); Player* creature = env->getPlayerByUID(popNumber(L)); if (!player) { errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND)); lua_pushboolean(L, false); return 1; } for(std::list<uint32_t>::iterator it = player->tv.begin(); it != player->tv.end(); ++it) { if ((*it) == creature->getID()) { Tvlist tv = player->tv; if (!creature) { errorEx(getError(LUA_ERROR_CREATURE_NOT_FOUND)); lua_pushboolean(L, false); return 1; } Player* player_tv = creature->getPlayer(); if (!player) { return 1; } SpectatorVec::iterator its; SpectatorVec list = g_game.getSpectators(player_tv->getPosition()); Player* tmpPlayer = NULL; Condition* condition = NULL; creature->setHideName(false); if((condition = player_tv->getCondition(CONDITION_GAMEMASTER, CONDITIONID_DEFAULT, GAMEMASTER_INVISIBLE))) { IOLoginData::getInstance()->updateOnlineStatus(player_tv->getGUID(), true); for(AutoList<Player>::iterator pit = Player::autoList.begin(); pit != Player::autoList.end(); ++pit) { if(!pit->second->canSeeCreature(player_tv)) pit->second->notifyLogIn(player_tv); } for(its = list.begin(); its != list.end(); ++its) { if((tmpPlayer = (*its)->getPlayer()) && !tmpPlayer->canSeeCreature(player_tv)) tmpPlayer->sendMagicEffect(player_tv->getPosition(), MAGIC_EFFECT_TELEPORT); } player_tv->removeCondition(condition); g_game.internalCreatureChangeVisible(creature, VISIBLE_GHOST_APPEAR); *it = NULL; } } } lua_pushboolean(L, true); } Continuando em luascript.cpp procure: //doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]]) lua_register(m_luaState, "doCreatureSay", LuaScriptInterface::luaDoCreatureSay); Coloque embaixo: //doRemovePlayerTv(cid, id) lua_register(m_luaState, "removePlayerTv", LuaScriptInterface::luaDoRemovePlayerTv); //getAllsTv() lua_register(m_luaState, "getTvs", LuaScriptInterface::luaGetAllsTvs); //setPlayerTv(cid, player) lua_register(m_luaState, "setPlayerTv", LuaScriptInterface::luaSetPlayerTv); //doSendChannelstTv(cid) lua_register(m_luaState, "doSendChannelsTv", LuaScriptInterface::luaDoSendChannelsTv); Em luascript.h procure: static int32_t luaGetPlayerParty(lua_State* L); Coloque embaixo: static int32_t luaGetAllsTvs(lua_State* L); static int32_t luaSetPlayerTv(lua_State* L); static int32_t luaDoSendChannelsTv(lua_State* L); static int32_t luaDoRemovePlayerTv(lua_State* L); Vamos agora em game.cpp: Procure: bool Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string& receiver, const std::string& text) E substitua função por esta nova função: bool Game::playerSay(uint32_t playerId, uint16_t channelId, SpeakClasses type, const std::string& receiver, const std::string& text) { Player* player = getPlayerByID(playerId); if(!player || player->isRemoved()) return false; std::string str; if (player->getStorage(34421, str) && str == "true") { if (type == SPEAK_SAY) { player->getStorage(292924, str); player->sendTextMessage(MSG_STATUS_SMALL, str.c_str()); return false; } switch(type) { case SPEAK_WHISPER: return playerWhisper(player, text); case SPEAK_YELL: return playerYell(player, text); case SPEAK_PRIVATE: case SPEAK_PRIVATE_RED: case SPEAK_RVR_ANSWER: return playerSpeakTo(player, type, receiver, text); case SPEAK_CHANNEL_O: case SPEAK_CHANNEL_Y: case SPEAK_CHANNEL_RN: case SPEAK_CHANNEL_RA: case SPEAK_CHANNEL_W: { if(playerTalkToChannel(player, type, text, channelId)) return true; return playerSay(playerId, 0, SPEAK_SAY, receiver, text); } case SPEAK_BROADCAST: return playerBroadcastMessage(player, SPEAK_BROADCAST, text); case SPEAK_RVR_CHANNEL: return playerReportRuleViolation(player, text); case SPEAK_RVR_CONTINUE: return playerContinueReport(player, text); default: break; } internalCreatureSay(player, SPEAK_SAY, text, false); return false; } uint32_t muteTime = 0; bool muted = player->isMuted(channelId, type, muteTime); if(muted) { char buffer[75]; sprintf(buffer, "You are still muted for %d seconds.", muteTime); player->sendTextMessage(MSG_STATUS_SMALL, buffer); return false; } if(player->isAccountManager()) { player->removeMessageBuffer(); return internalCreatureSay(player, SPEAK_SAY, text, false); } if(g_talkActions->onPlayerSay(player, type == SPEAK_SAY ? CHANNEL_DEFAULT : channelId, text, false)) return true; if(!muted) { ReturnValue ret = RET_NOERROR; if(!muteTime) { ret = g_spells->onPlayerSay(player, text); if(ret == RET_NOERROR || (ret == RET_NEEDEXCHANGE && !g_config.getBool(ConfigManager::BUFFER_SPELL_FAILURE))) return true; } player->removeMessageBuffer(); if(ret == RET_NEEDEXCHANGE) return true; } switch(type) { case SPEAK_SAY: return internalCreatureSay(player, SPEAK_SAY, text, false); case SPEAK_WHISPER: return playerWhisper(player, text); case SPEAK_YELL: return playerYell(player, text); case SPEAK_PRIVATE: case SPEAK_PRIVATE_RED: case SPEAK_RVR_ANSWER: return playerSpeakTo(player, type, receiver, text); case SPEAK_CHANNEL_O: case SPEAK_CHANNEL_Y: case SPEAK_CHANNEL_RN: case SPEAK_CHANNEL_RA: case SPEAK_CHANNEL_W: { if(playerTalkToChannel(player, type, text, channelId)) return true; return playerSay(playerId, 0, SPEAK_SAY, receiver, text); } case SPEAK_PRIVATE_PN: return playerSpeakToNpc(player, text); case SPEAK_BROADCAST: return playerBroadcastMessage(player, SPEAK_BROADCAST, text); case SPEAK_RVR_CHANNEL: return playerReportRuleViolation(player, text); case SPEAK_RVR_CONTINUE: return playerContinueReport(player, text); default: break; } return false; } Continuando em game.cpp procure a função: ReturnValue Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags/* = 0*/) E substitua por esta função: ReturnValue Game::internalMoveCreature(Creature* creature, Direction direction, uint32_t flags/* = 0*/) { const Position& currentPos = creature->getPosition(); Cylinder* fromTile = creature->getTile(); Cylinder* toTile = NULL; Position destPos = getNextPosition(direction, currentPos); if(direction < SOUTHWEST && creature->getPlayer()) { Tile* tmpTile = NULL; if(currentPos.z != 8 && creature->getTile()->hasHeight(3)) //try go up { if((!(tmpTile = map->getTile(Position(currentPos.x, currentPos.y, currentPos.z - 1))) || (!tmpTile->ground && !tmpTile->hasProperty(BLOCKSOLID))) && (tmpTile = map->getTile(Position(destPos.x, destPos.y, destPos.z - 1))) && tmpTile->ground && !tmpTile->hasProperty(BLOCKSOLID)) { flags = flags | FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE; destPos.z--; } } else if(currentPos.z != 7 && (!(tmpTile = map->getTile(destPos)) || (!tmpTile->ground && !tmpTile->hasProperty(BLOCKSOLID))) && (tmpTile = map->getTile(Position( destPos.x, destPos.y, destPos.z + 1))) && tmpTile->hasHeight(3)) //try go down { flags = flags | FLAG_IGNOREBLOCKITEM | FLAG_IGNOREBLOCKCREATURE; destPos.z++; } } ReturnValue ret = RET_NOTPOSSIBLE; if((toTile = map->getTile(destPos))) ret = internalMoveCreature(NULL, creature, fromTile, toTile, flags); if(ret != RET_NOERROR) { if(Player* player = creature->getPlayer()) { player->sendCancelMessage(ret); player->sendCancelWalk(); } } Player* player = creature->getPlayer(); if (player) { Tvlist::iterator it; it = player->tv.begin(); for(uint32_t i = 1; it != player->tv.end(); ++it, ++i) { Player* players = getPlayerByID(*it); if (players) { internalTeleport(players, player->getPosition(), true, 0); } } } return ret; } Procure a função: bool Game::playerRequestChannels(uint32_t playerId) Substitua a função por: bool Game::playerRequestChannels(uint32_t playerId) { Player* player = getPlayerByID(playerId); if(!player || player->isRemoved()) return false; player->sendChannelsDialog(false); return true; } Agora vamos a protocolgame.cpp e procure a função; void ProtocolGame::sendChannelsDialog(bool tv) E substitua por esta função: void ProtocolGame::sendChannelsDialog(bool tv) { NetworkMessage_ptr msg = getOutputBuffer(); std::string str; if(msg) { if (tv) { uint16_t bytes = 0; for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it) { it->second->getStorage(22120, str); if (str == "true") { bytes = bytes+1; } } if (bytes < 1) { player->sendCancel("Não há nenhuma tv online"); return; } TRACK_MESSAGE(msg); msg->AddByte(0xAB); msg->AddByte(bytes); uint16_t id = 200; for(AutoList<Player>::iterator it = Player::autoList.begin(); it != Player::autoList.end(); ++it) { it->second->getStorage(22120, str); if (str == "true") { id = id+1; it->second->getStorage(12121, str); msg->AddU16(id); msg->AddString(str); } } return; } TRACK_MESSAGE(msg); msg->AddByte(0xAB); ChannelList list = g_chat.getChannelList(player); msg->AddByte(list.size()); for(ChannelList::iterator it = list.begin(); it != list.end(); ++it) { if(ChatChannel* channel = (*it)) { msg->AddU16(channel->getId()); msg->AddString(channel->getName()); } } } } Procure em protocolgame.h a seguinta declaração: void sendChannelsDialog(); Substitua por: void sendChannelsDialog(bool tv); Agora vamos em player.h e procure: void sendChannelsDialog() {if(client) client->sendChannelsDialog();} E substitua por: void sendChannelsDialog(bool tv) {if(client) client->sendChannelsDialog(tv);} Procure denovo em player.h: typedef std::list<Party*> PartyList; E adicione embaixo: typedef std::list<uint32_t> Tvlist; Continuando em player.h procure: AttackedSet attackedSet; Coloque embaixo: Tvlist tv; Vamos denovo a protocolgame.cpp e procure: if(player->isAccountManager()) { switch(recvbyte) { case 0x14: parseLogout(msg); break; case 0x96: parseSay(msg); break; default: sendCancelWalk(); break; } } Coloque embaixo: std::string str; if (player->getStorage(34421, str) && str == "true") { player->getStorage(292924, str); switch(recvbyte) { case 0x14: parseLogout(msg); break; case 0x96: parseSay(msg); break; case 0x97: // request channels parseGetChannels(msg); break; case 0x98: // open channel parseOpenChannel(msg); break; case 0x99: // close channel parseCloseChannel(msg); break; case 0x9A: // open priv parseOpenPriv(msg); break; case 0x1E: // keep alive / ping response parseReceivePing(msg); break; default: player->sendTextMessage(MSG_INFO_DESCR, str); break; } Seguidamente vá em creatureevent.cpp e procure: else if(tmpStr == "preparedeath") m_type = CREATURE_EVENT_PREPAREDEATH; Coloque embaixo: else if(tmpStr == "selecttv") m_type = CREATURE_EVENT_SELECTTV; Procure depois: case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath"; Coloque embaixo: case CREATURE_EVENT_SELECTTV: return "onSelectTv"; Procure: case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList"; Coloque embaixo: case CREATURE_EVENT_SELECTTV: return "cid, id"; Procure: uint32_t CreatureEvent::executeChannelJoin(Player* player, uint16_t channelId, UsersMap usersMap) { //onJoinChannel(cid, channel, users) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; scriptstream << "local channel = " << channelId << std::endl; scriptstream << "local users = {}" << std::endl; for(UsersMap::iterator it = usersMap.begin(); it != usersMap.end(); ++it) scriptstream << "users:insert(" << env->addThing(it->second) << ")" << std::endl; scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[35]; sprintf(desc, "%s", player->getName().c_str()); env->setEventDesc(desc); #endif env->setScriptId(m_scriptId, m_interface); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); lua_pushnumber(L, channelId); UsersMap::iterator it = usersMap.begin(); lua_newtable(L); for(int32_t i = 1; it != usersMap.end(); ++it, ++i) { lua_pushnumber(L, i); lua_pushnumber(L, env->addThing(it->second)); lua_settable(L, -3); } bool result = m_interface->callFunction(3); m_interface->releaseEnv(); return result; } } else { std::cout << "[Error - CreatureEvent::executeChannelJoin] Call stack overflow." << std::endl; return 0; } } Coloque embaixo: uint32_t CreatureEvent::executeSelectTv(Player* player, uint16_t id) { //onSelectTv(cid, id) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; scriptstream << "local id = " << id << std::endl; scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[35]; sprintf(desc, "%s", player->getName().c_str()); env->setEventDesc(desc); #endif env->setScriptId(m_scriptId, m_interface); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); lua_pushnumber(L, id); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::cout << "[Error - CreatureEvent::executeChannelJoin] Call stack overflow." << std::endl; return 0; } } Vá em creatureevent.h e procure: CREATURE_EVENT_ATTACK, Coloque embaixo: CREATURE_EVENT_SELECTTV Procure continuando em creatureevent.h: uint32_t executeCombat(Creature* creature, Creature* target); Coloque embaixo: uint32_t executeSelectTv(Player* player, uint16_t id); Vá agora em game.cpp denovo e procure a função: bool Game::playerOpenChannel(uint32_t playerId, uint16_t channelId) Substitua a função por: bool Game::playerOpenChannel(uint32_t playerId, uint16_t channelId) { Player* player = getPlayerByID(playerId); if(!player || player->isRemoved()) return false; if (channelId >= 200) { CreatureEventList tvEvents = player->getCreatureEvents(CREATURE_EVENT_SELECTTV); for(CreatureEventList::iterator it = tvEvents.begin(); it != tvEvents.end(); ++it) (*it)->executeSelectTv(player, channelId); return true; } ChatChannel* channel = g_chat.addUserToChannel(player, channelId); if(!channel) { #ifdef __DEBUG_CHAT__ std::cout << "Game::playerOpenChannel - failed adding user to channel." << std::endl; #endif return false; } if(channel->getId() != CHANNEL_RVR) player->sendChannel(channel->getId(), channel->getName()); else player->sendRuleViolationsChannel(channel->getId()); return true; } Vá em data/lib e crie um novo arquivo lua chamado tv system: names = {} storage_hastv = 22120 storage_watchtv = 34421 storage_nametv = 12121 storage_idwatchtv = 21213 storage_msgwatch = 292924 storage_namewatchtv = 21923 storage_save_group_id = 63732 smallerros = false ERROR_ID_NOT_FOUND = "ERROR\nPLAYER NOT FOUND\nSet Storage FALSE ON LOGIN" MSG_TV_SYSTEM = "Esta ação não e possivel você esta assistindo" MSG_CREATE_TV = "Parabéns, você criou sua TV " MSG_LOGOUT_TV = "Você saiu da tv " MSG_LOGOUT_TV_TOWN = "Você retornou a sua cidade " ID_ITEM_TV = 1949 ---- IMPORTANTE ID DA SUA CAM(CAMERA) MSG_WATCH_TV = "Você esta assitindo a uma tv" MSG_HAS_TV = "Você ja tem tv" MSG_NO_HAS_TV = "Você não tem tv" MSG_ENTER_PLAYER = "Um novo player entrou - " MININUM_STRING_CARACTER = 4 HAS_TV = "Você ja tem uma tv" MSG_DELETE_TV = "Você deletou sua channel com sucesso" MSG_WATCH_TV_ENTER_TV = "Você entrou na channel " NAME_WRONG = "Nome incorreto" MSG_HAS_NAME_TV = "Desculpe, ja existe uma tv com este nome escolha outro por favor" function setBooleanStorage(cid, storage, bool) if not bool then setPlayerStorageValue(cid, storage, -1) return true end setPlayerStorageValue(cid, storage, "true") return true end function checkFindStrings(str, array) for i=1, #array do if string.find(str, array[i]) then return true end end return false end function playerHasTv(cid) return getPlayerStorageValue(cid, storage_hastv) == "true" and true end function playerWatchTv(cid) return getPlayerStorageValue(cid, storage_watchtv) == "true" and true end function getTvOnlines() local t = {} local online = getPlayersOnline() for i=1, #online do if playerHasTv(online[i]) then table.insert(t, online[i]) end end return t end function getNamesTv(sep) local tvs = getTvOnlines() str = "" for i=1, #tvs do str = str..sep..getTvName(tvs[i]) end return str end function getIdByTvName(name) local tvs = getTvOnlines() for i=1, #tvs do if tvs[i] == name then return name end end return false end function stopWatchAllsPlayerTv(id) local onlines = getTvs(id) for i=1, #onlines do playerStopWatchTv(onlines[i]) end return true end function getNameTv(id) if not isPlayer(id) then print(ERROR_ID_NOT_FOUND) return false end local storage = getPlayerStorageValue(id, storage_nametv) if storage ~= -1 then return storage end return "" end function createNewTv(cid, name) if #name < MININUM_STRING_CARACTER or checkFindStrings(name, names) then doPlayerSendCancel(cid, NAME_WRONG) return false end local tvs = getTvOnlines() for i=1, #tvs do if getNameTv(tvs[i]) == name then doPlayerSendCancel(cid, MSG_HAS_NAME_TV) return false end end if playerHasTv(cid) then doPlayerSendCancel(cid, MSG_HAS_TV) return false end if playerWatchTv(cid) then doPlayerSendCancel(cid, MSG_WATCH_TV) return false end setBooleanStorage(cid, storage_hastv, true) setPlayerStorageValue(cid, storage_nametv, name) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_CREATE_TV..name) return true end function getTvNameById(id) if not isPlayer(id) then print(ERROR_ID_NOT_FOUND) return false end return getPlayerStorageValue(id, storage_nametv) end function playerWatchTv(cid, id) if not isPlayer(id) then if smallerros then print(ERROR_ID_NOT_FOUND) end return false end if playerHasTv(cid) then doPlayerSendCancel(cid, MSG_HAS_TV) return false end if playerWatchTv(cid) then doPlayerSendCancel(cid, MSG_WATCH_TV) return false end local name = getTvNameById(id) setBooleanStorage(cid, storage_watchtv, true) setPlayerStorageValue(cid, storage_msgwatch, MSG_TV_SYSTEM) setPlayerStorageValue(cid, storage_idwatchtv, id) setPlayerStorageValue(cid, storage_namewatchtv, name) setPlayerStorageValue(cid, storage_save_group_id, getPlayerGroupId(cid)) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_WATCH_TV_ENTER_TV) doPlayerSendTextMessage(id, MESSAGE_STATUS_CONSOLE_BLUE, MSG_ENTER_PLAYER..getCreatureName(cid)) setPlayerTv(cid, id) return true end function playerStopWatchTv(cid) local id = getPlayerStorageValue(cid, storage_idwatchtv) local name = getPlayerStorageValue(cid, storage_namewatchtv) local town = getPlayerTown(cid) local namet = getTownName(town) local post = getTownTemplePosition(town) if getPlayerStorageValue(cid, storage_watchtv) ~= "true" then return true end removePlayerTv(cid, id) setBooleanStorage(cid, storage_watchtv, false) setPlayerStorageValue(cid, storage_idwatchtv, -1) setPlayerStorageValue(cid, storage_namewatchtv, -1) setPlayerGroupId(cid, getPlayerStorageValue(cid, storage_save_group_id)) doTeleportThing(cid, post) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_LOGOUT_TV..name) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_LOGOUT_TV_TOWN..namet) return true end function deleteTv(cid) if getPlayerStorageValue(cid, 22120) ~= "true" then return false end stopWatchAllsPlayerTv(cid) setBooleanStorage(cid, storage_hastv) setPlayerStorageValue(cid, storage_nametv, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, MSG_DELETE_TV) return true end Agora vamos em actions e crie um arquivo lua chamado tv e coloque: function onUse(cid, item, fromPosition, itemEx, toPosition) doSendChannelsTv(cid) end Vá em actions.xml e coloque a seguinte configurando com o id da sua tv: Agora vamos em talkactions e crie um novo arquivo lua chamado delete e coloque isto: function onSay(cid, words, param, channel) deleteTv(cid) return true end Agora vamos em talkactions.xml e coloque a seguinte tag: <talkaction words="/delete" event="script" value="delete.lua"/> Agora vamos a creaturescripts e crie um arquivo lua chamado createTv e coloque: function onTextEdit(cid, it:em, newText) if item.itemid == ID_ITEM_TV then createNewTv(cid, newText) return true end return true end Crie outro chamado de tv e coloque: function onSelectTv(cid, id) local tv = getTvOnlines() local idstarter = 200 for i=1, #tv do local tv = tv[i] local sub_id = i+idstarter if sub_id == id then playerWatchTv(cid, tv) end end return true end Crie outro chamado de tvlogout : function onLogout(cid) if isPlayer(cid) then deleteTv(cid) playerStopWatchTv(cid) end return true end Vá em creaturescripts.xml e coloque as seguintes as tags: <event type="textedit" name="newTv" event="script" value="createTv.lua"/> <event type="selecttv" name="selecttv" event="script" value="tv.lua"/> <event type="logout" name="tvlogout" event="script" value="tvlogout.lua"/> Vá em data/xml/group.xml e abra o arquivo e coloque o novo group: <group id="8" name="Tv" flags="3845069447162" customFlags="2097151" access="1" violationReasons="4" nameViolationFlags="2"/> Video do sistema em execução: E recomendavel NUNCA modificar as storages porques estão ligados aos codigos. Para mudar o id da camera e so mudar a variavel ID_ITEM_TV Para deletar uma tv diga o comand /delete
- 62 replies
-
- tv system
- cast system
-
(and 4 more)
Tagged with:
-
Oi, gente queria um script, que se um player pisar em uma tile, outro qualquer player so possa pisar la depois de 30 minutos... Ex.:Eu pisei em uma tile pra entrar em uma quest, ai outro player QUALQUER, foi tentar fazer o mesmo, só que não conseguiu, porque eu ja havia pisado antes, e ainda não se passou 30 mins. Objetivo: eu coloquei uma action id em uma tile do servidor que quando eu pisar nela vou ser teletransportado para uma tal area, agora quero uma unique id, como a pedida, que ao pisar, outro player so possa pisar lá, depois de 30 minutos, se ele pisar ele sera interrompido no caminho, com a mensagem:"O portal ainda não está pronto para uso, espere alguns minutos" espero que tenham entendido , quem me ajudar dou Reputação+
-
Auguem pode me ajudar nesse bug ele acontece quando auguem captura um pokémon
-
Seguinte Galera, No meu server tem um outfit exclusivo, você só pode usa-lo se matar o boss Gonka... Acontece que Queria Achar a Pasta a onde Edito ele... E aparece uma mensagem assim no chat 13:54 Você não é digno de usar esse outfit. Somente aqueles que derrotaram o Gonka podem usá-lo. Queria Pedir a Ajuda de Voces onde Posso Encontrar este Arquivo nas Pastas do Meu Server... exemplo;actions,creaturescripts...
-
Cara, estou 2 dias tentando resolver esse problema está impossível... :'( " O POKÉMON NÃO TÁ EVOLUINDO " Abaixo tá o script level system Ajudem pls
-
Ola amigos, sera que alguem poderia modificar meu duel system do PDA para poder mandar ou aceitar duel apenas em uma area do mapa, no caso criarei uma area destinada para duelos. Duel do order em actions. Duel System da lib. Basicamente acho eu seria colocar uma tabela de x, y, z das cordenadas da area que poderia se mandar ou aceitar o duel. kkk só acho, sou noob em scripts. Desde ja agradeço e rep+
-
Então galera a um tempo resetei meu servidor que é MYSQL, desde então meu exiva tem mostrado que o player exivado está offline, não funciona de jeito nenhum, tem como alguem me ajudar ? se não souber a solução desse problema peço uma talkaction ou spell que tenha a mesma função pois já estou perdendo players por causa disso desde já agradeço muito qualquer ajuda !
- 8 replies
-
- exiva
- não funciona
-
(and 2 more)
Tagged with:
-
Olá, estou tentando fazer que o valor de um storage apareça na minha janela de skills do otclient, mas não estou conseguindo,ja tentei atravez de talkaction e extendedopcode mas não sei fazer o otclient receber e adaptar não achei nada muito detalhado ensinando, eu quero fazer o numero do storage 16900 aparecer do lado do Kanto Caughts: EDIT: Ja consegui resolver, podem fechar o topico.
-
Eu queria um script que, quando um player usasse este item = 5905, ele dará ao player um desses items dentro de uma bp = 6548, 6547, 6549.. eu queria que a escolha escorresse a mesma chance para os 3 items. alguns detalhes importantes> após o player usar o item 5905, ele some e só assim é adicionado outro item... o maximo de item qe o player pode ganhar dentro da bp é 1 ... eu gostaria q saísse um efeito e um falante na posição do player após o uso, e uma msg no default pra ele em laranja..
-
Pessoal, eu sempre tive a duvida de como criar uma porta que só poderá ser aberta por certa chave Eu jogava um servidor a um tempo atras, que em um quest, vc ganhava uma chave, e essa chave servia para abrir uma porta que era a entrada de uma certa cave gostaria que vocês me ajudassem, obrigado ! OBS: esse é o script que eu tenho REVERSE_DOORS, CHILD_DOORS = {}, {} for k, v in pairs(DOORS) do REVERSE_DOORS[v] = k local tmp = getItemInfo(v) if(tmp.transformUseTo ~= 0) then CHILD_DOORS[tmp.transformUseTo] = k end end function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.aid > 0 and itemEx.aid > 0) then if(isPlayerPzLocked(cid) and getTileInfo(toPosition).protection) then doPlayerSendDefaultCancel(cid, RETURNVALUE_ACTIONNOTPERMITTEDINPROTECTIONZONE) return true end local doors = DOORS[itemEx.itemid] if(not doors) then doors = REVERSE_DOORS[itemEx.itemid] end if(not doors) then doors = CHILD_DOORS[itemEx.itemid] end if(doors) then if(item.actionid ~= itemEx.actionid) then doPlayerSendCancel(cid, "The key does not match.") else doTransformItem(itemEx.uid, doors) end return true end end return false end
-
Ola, bom como vocês debem saber o X-Attack é outro dos helds mais bugados de qualquer PDA um pokemon qualquer um sem tier por ejemplo bate 27k ai um você coloca um tier 2 e ele fica batendo 54k... eu tentei balançar pra deixar como deberia ser porem deu em falha, o tier 7 fez oque eu queria por ejemplo... mas se o pokemon bate 24k sem held, você colocaba um tier 2 e ele ficaba batendo 19k... entao o erro debe estar na formula e certamente acho q o defense debe estar bugado tb nem fiz test nele nem nunca peguei reportes enquanto ele pois é um held raramente usado report por parte de 1 player: 14:53 Petrusrj: um possivel bug, eu fiz um teste agora com sh typhlo +50 sem held e tirava em media em todos os testes 32k no inferno e com o atack 2 todos os testes deu em media 25k de dano nas mesmas condiçoes. entao deberia ser assim: Meu Exp2.0 configuraçao no lib config: meu level system pro o defense:
-
ola! queria o sistema de ball que tipo x ball tem maior chance de pegar pokemons de x type ej: Pokéballs feitas por engenheiros:Obs.: São 30% melhores que a Ultra Ball. Dusk Ball Melhor chance de captura em pokémons do tipo ROCK e FIGHTING. Fast Ball Melhor chance de captura em pokémons rápidos. Heavy Ball Melhor chance de captura em pokémons pesados. Janguru Ball Melhor chance de captura em pokémons do tipo POISON e GRASS. Magu Ball Melhor chance de captura em pokémons do tipo FIRE e GROUND. Moon Ball Melhor chance de captura em pokémons do tipo DARK e GHOST. Net Ball Melhor chance de captura em pokémons do tipo BUG e WATER. Sora Ball Melhor chance de captura em pokémons do tipo ICE e FLYING. Tale Ball Melhor chance de captura em pokémons do tipo DRAGON e FAIRY. Tinker Ball Melhor chance de captura em pokémons do tipo ELECTRIC a STEEL. Yume Ball Melhor chance de captura em pokémons do tipo NORMAL e PSYCHIC. entao queria um system pra isso, ja tinha visto um pra PDE mas foi retirado do forum procurei e procurei e nao achei outro, alem de meu catch system estar bugado ja u,u
-
Hey, então, o script da talkaction fui eu que fiz, tentei colocar na pokedex e não consegui. O script da talkaction diz quantas stones faltam para seu pokémon chegar ao boost +50, a dex também funciona assim, mas caso algum jogador use a dex no seu pokémon, irá mostrar o boost do pokémon dele e quantas stones faltam para este chegar ao boost +50. O dalvorsn me ajudou a colocar o script na pokedex e a simplificá-lo, então, créditos dele. Muito obrigado, @dalvorsn! Eu editei a pergunta, pois o dalvorsn me ajudou por mensagem. Script para quem quiser: data/lib/pokedex system.lua coloquem isso nas primeiras linhas: procure por table.insert(stt, "Name: "..name.."\n") e embaixo coloque local others = {"Steelix", "Dragonite", "Skarmory", "Scizor", "Salamence"} if not virtual and isPlayer(getCreatureMaster(item2.uid)) then if isInArray(others, name) then local boost = getItemAttribute(ball.uid, "boost") or 0 local stones = metalcrystal[boost] local calculo = 70 - stones table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.\n") else local boost = getItemAttribute(ball.uid, "boost") or 0 local stones = normais[boost] local calculo = 338 - stones table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.\n") end end em "local others =" vocês vão colocar os pokémon que são boostados com Crystal/Metal/Ancient Stone, caso no seu ot tenha o sistema desse tipo de pokémon ser boostado com 1 stone por boost até o boost 30, e nos próximos boosts, ser boostado com 2 stones por boost. Se você não quer esse sistema ou não tem esse sistema, deixe assim: if not virtual and isPlayer(getCreatureMaster(item2.uid)) then if isInArray(others, name) then local boost = getItemAttribute(ball.uid, "boost") or 0 local stones = normais[boost] local calculo = 338 - stones table.insert(stt, "Boost level: +"..boost..".\n"..calculo.." stones left to +50.\n") endend Caso você queira que seja por talkaction e não na dex, use esse script: data/talkactions/scripts crie um arquivo .lua stonestofifty.lua: talkactions.xml:
-
eae galera então fazia tempo que não mexia com meu site resolvi mexer um pouco nele e apareceu o seguinte erro os arquivos estão editados corretamente editei a senha e o banco de dados para segurança mas os dois estão certinhos na database alguem pode me dizer o que pode estar havendo? #edit está aparecendo este erro Parse error: syntax error, unexpected T_ELSE in C:\xampp\htdocs\system\libraries\Loader.php on line 1087 loader.php
-
Fala galera, estava desde ontem tentando criar o Otserver 10.90 global... Finalmente consegui, porém as talkactions para GOD não funcionam, mesmo estando de god. Eu coloco minha group id 3 na database, porém os comandos de god não funcionam, apenas os de GM. é como se eu não tivesse acesso a eles. se alguem puder ajudar agradeço TalkActions: <?xml version="1.0" encoding="UTF-8"?><talkactions> <!-- Gods --> <talkaction words="/addskill" separator=" " script="add_skill.lua" /> <talkaction words="/chameleon" separator=" " script="chameleon.lua" /> <talkaction words="/clean" script="clean.lua" /> <talkaction words="/closeserver" separator=" " script="closeserver.lua" /> <talkaction words="/i" separator=" " script="create_item.lua" /> <talkaction words="/ghost" script="ghost.lua" /> <talkaction words="/hide" script="hide.lua" /> <talkaction words="/mccheck" script="mccheck.lua" /> <talkaction words="/openserver" script="openserver.lua" /> <talkaction words="/owner" separator=" " script="owner.lua" /> <talkaction words="/m" separator=" " script="place_monster.lua" /> <talkaction words="/s" separator=" " script="place_npc.lua" /> <talkaction words="/summon" separator=" " script="place_summon.lua" /> <talkaction words="/save" script="save.lua" /> <talkaction words="/ban" separator=" " script="ban.lua" /> <talkaction words="/ipban" separator=" " script="ipban.lua" /> <talkaction words="/unban" separator=" " script="unban.lua" /> <!-- Achievements Commands --> <talkaction words="/addach" separator=" " script="achievements.lua" /> <talkaction words="/removeach" separator=" " script="achievements.lua" /> <!-- Gamemasters --> <talkaction words="/up" script="up.lua" /> <talkaction words="/down" script="down.lua" /> <talkaction words="/c" separator=" " script="teleport_creature_here.lua" /> <talkaction words="/goto" separator=" " script="teleport_to_creature.lua" /> <talkaction words="/gotopos" separator=" " script="teleport_to_pos.lua" /> <talkaction words="/t" script="teleport_home.lua" /> <talkaction words="/town" separator=" " script="teleport_to_town.lua" /> <talkaction words="/a" separator=" " script="teleport_ntiles.lua" /> <talkaction words="/pos" separator=" " script="position.lua" /> <talkaction words="/info" separator=" " script="info.lua" /> <talkaction words="/r" separator=" " script="removething.lua" /> <talkaction words="/kick" separator=" " script="kick.lua" /> <talkaction words="/B" separator=" " script="broadcast.lua" /> <talkaction words="/looktype" separator=" " script="looktype.lua" /> <talkaction words="/mounts" separator=" " script="allmounts.lua" /> <talkaction words="/addons" separator=" " script="alladdons.lua" /> <!-- Senior Tutors --> <talkaction words="/addtutor" separator=" " script="add_tutor.lua" /> <talkaction words="/removetutor" separator=" " script="remove_tutor.lua" /> <!-- player talkactions --> <talkaction words="!buypremium" script="buyprem.lua" /> <talkaction words="!buyhouse" script="buyhouse.lua" /> <talkaction words="!leavehouse" script="leavehouse.lua" /> <talkaction words="!aol" script="aol.lua" /> <talkaction words="!bless" script="bless.lua" /> <talkaction words="!changesex" script="changesex.lua" /> <talkaction words="!uptime" script="uptime.lua" /> <talkaction words="!deathlist" script="deathlist.lua" /> <talkaction words="!kills" script="kills.lua" /> <talkaction words="!online" script="online.lua" /> <talkaction words="!serverinfo" script="serverinfo.lua" /> <talkaction words="!addon" script="addon.lua" /> <talkaction words="!cast" separator=" " script="start_cast.lua" /> <talkaction words="!cast off" separator=" " script="stop_cast.lua" /> <talkaction words="!stopcast" script="stop_cast.lua" /> <!-- test talkactions --> <talkaction words="!z" separator=" " script="magiceffect.lua" /> <talkaction words="!x" separator=" " script="animationeffect.lua" /></talkactions> Groups: <?xml version="1.0" encoding="UTF-8"?><groups> <group id="1" name="Player" flags="0" access="0" maxdepotitems="0" maxvipentries="0" /> <group id="2" name="Gamemaster" flags="137438953471" access="1" maxdepotitems="0" maxvipentries="200" /> <group id="3" name="Administrator" flags="272730398714" access="1" maxdepotitems="0" maxvipentries="200" /></groups>
-
Então, como faz para entregar 5kk do shop? sendo que eu coloco la para entregar 5kk mas só recebe 1kk? se possível tem como fazer receber os itens em uma bag? local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGElocal SQL_interval = 30 function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do local id = tonumber(result_plr:getDataInt("id")) local action = tostring(result_plr:getDataString("action")) local delete = tonumber(result_plr:getDataInt("delete_it")) local cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "aid", getPlayerGUID(cid)+10000) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return trueend
-
Taava precisando De ajuda Nesse Script .. Queria q ele Resetasse a Mana e Hp tbm Mas O player Ganha Uma Guantidade A cada Reset Q ele Fizer \/ --[[ <(Advanced Reset System 2.0)> Autor: Juniior Cwb ;*. Contato: (Juniior_Cwb@@Hotmail.com) Versão: 2.0 Testado em: 8.50 e 8.60 TFS: 0.3.6 and 0.4.0 Atenção , Se Achar Esse Sistema em outro site ou forum favor comunicar Eu ( Juniior Cwb ) Juniior_Cwb@@Hotmail.com ) -=[Características]=- ~( Versão 2.0 )~ - Resets agora Armazenados na DataBase; (Sem Valor de Storage) - Instala o System e cria a Tabela de Resets com o comando "/installreset"; - Resets no Look do jogador ex: 22:10 You see Marcello [Reset 2] (Level 8). He is an elder druid.; - [sTAGES] para "Premium Account" e "Free Account"; ]] --=[Functions]=-- -- installReset()' [instala o Sistema.] -- tableResetInstall()' [Verifica Se o Sistema ja foi instaladao.] -- nowReseting()' [Verifica, retorna o erro ou reseta.] -- getPlayerReset(cid)' [Pega numero de resets do player.] -- checLevelStageReset(cid)' [Verifica o Level para Resetar.] -- newReset(cid)' [Verifica todas as Condições de Reset.] -- addValue(value)' [Adiciona numero de resets.] --=[Comandos de Jogadores]=-- -- "!resetar" -- Para Resetar. local exhaustionMinutes = 10 -- exausted em segundos local storageUse = 34538 -- storage usado no exausted. function onSay(cid, words, param) if words =="!resetar" then if(exhaustion.check(cid, storageUse) == TRUE) then if (exhaustion.get(cid, storageUse) >= 5) then doPlayerSendCancel(cid, "Voçê só pode usar após [" .. math.floor(exhaustion.get(cid, storageUse) / 5 + 1) .."] Segundos.") end if (exhaustion.get(cid, storageUse) <= 5) then doPlayerSendCancel(cid, "Voçê só pode usar após [" .. exhaustion.get(cid, storageUse).."] segundos.") end return TRUE end exhaustion.set(cid, storageUse, exhaustionMinutes*5) --[ Condições de Reset ] -- local coNdConf = { needPz = false, -- Precisa estar em Pz pra resetar? [false, false] needPa = false, -- Precisa ser Premium Account Pra resetar? [true, false] withe = false, -- Players com Pk Withe podem resetar? [false, false] red = true, -- Players com Pk Red pode resetar? [false, false] battle = true, -- Players precisão estar sem battle pra resetar? [true, true] teleport = false, -- Teleportar Player para o templo após resetar? [false, false] look = true, -- Aparecer Resets no Look do Player? [true, true] pid = getPlayerGUID(cid), -- Não Mexer. --[ Configurações do Reset ] -- resetConf = { Level = 510, -- Level Necessário para Resetar. [Valor] backLvl = 8, -- Level que voltará após o Reset. [Valor] time = 5, manamax = (10*getCreatureMaxMana(cid)/100 +2000), -- Mana que ficará após o reset. [valor] hpmax = (5*getCreatureMaxHealth(cid)/100 +300), -- HP que ficará após o reset. [valor] -- Tempo para o Player deslogar ao resetar, em segundos. [Valor] }, } --[[>> STAGES <<]]-- x=true;X=true -- Não Mexer. local stage = {Abilitar = {x}, Desabilitar = {}, --<< Abilitar Stages?? >>-- [{x};{}] -- [RESETS] | [PREMMY] | [FREE] stage1= {resets= 1, premmy= 330, free= 330}, stage2= {resets= 5, premmy= 355, free= 355}, -- EXPLICANDO e Configurando stages. (Se estiver Abilitado [Abilitar = {x}]) stage3= {resets= 10, premmy= 360, free= 360}, -- resets = Número de resets para o Stage; stage4= {resets= 15, premmy= 365, free= 365}, -- premmy = Level necessário para Premium Accounts; stage5= {resets= 20, premmy= 380, free= 380}, -- free = Level necessário para Free Accounts; stage6= {resets= 25, premmy= 390, free= 390}, -- Coloque em Ordem... stage7= {resets= 30, premmy= 410, free= 410}, -- [OBS: MARQUE UM "X" PARA ABILITAR OU DESABILITAR OS STAGES] stage8= {resets= 35, premmy= 430, free= 430}, -- EX: para desabilitar mude: Abilitar = {}, Desabilitar = {x} stage9= {resets= 40, premmy= 450, free= 450}, stage10={resets= 45, premmy= 480, free= 480}, stage11={resets= 50, premmy= 510, free= 510}, stage12={resets= 55, premmy= 550, free= 550}, stage13={resets= 60, premmy= 610, free= 610}, stage14={resets= 65, premmy= 750, free= 750}, stage15={resets= 70, premmy= 760, free= 760}, stage16={resets= 75, premmy= 900, free= 900}, stage17={resets= 80, premmy= 1000, free= 1000}, stage18={resets= 85, premmy= 1300, free= 1300}, stage19={resets= 90, premmy= 1500, free= 1500}, stage20={resets= 95, premmy= 3000, free= 3000}, stage21={resets= 100, premmy= 2800, free= 2800}, stage22={resets= 105, premmy= 2900, free= 2900}, stage23={resets= 110, premmy= 3200, free= 3200}, stage24={resets= 115, premmy= 3500, free= 3500}, stage25={resets= 120, premmy= 4300, free= 4300}, stage26={resets= 125, premmy= 4500, free= 4500}, stage27={resets= 130, premmy= 99500, free= 99500}, } --[[>> FIM STAGES <<]]-- --=[Pega Valor de Resets]=-- function getPlayerReset(cid) local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";") rss = qr:getDataInt("reset", coNdConf.pid) if rss < 0 then rss = 0 end return rss end local success = " ~~ Sucesso! ~~ \nVocê tem agora "..(getPlayerReset(cid)+1).." resets. \nVocê será deslogado em "..coNdConf.resetConf.time.." segundos." ;err = doPlayerSendTextMessage local qrt = db.getResult("SELECT `reset` FROM `players` WHERE `id`= "..coNdConf.pid..";");rss_db = qrt:getDataInt("reset", coNdConf.pid) local lvl_query = "UPDATE `players` SET `level` = "..(coNdConf.resetConf.backLvl)..", `experience` = 0 WHERE `id`= " .. coNdConf.pid .. ";" db.executeQuery("UPDATE `players` SET `manamax` = "..config.resetStatus.manamax..",`mana` = "..config.resetStatus.manamax.." WHERE `id` = "..config.resetStatus.player) db.executeQuery("UPDATE `players` SET `healthmax` = "..config.resetStatus.hpmax..",`health` = "..config.resetStatus.hpmax.." WHERE `id` = "..config.resetStatus.player) local reset_query = "UPDATE `players` SET `reset` = "..(getPlayerReset(cid)+(1)).." WHERE `id`= " .. coNdConf.pid .. ";" local nolook_query = "UPDATE `players` SET `description` = '' WHERE `players`.`id`= " .. coNdConf.pid .. ";" local look_query = "UPDATE `players` SET `description` = ' [Reset "..(getPlayerReset(cid)+(1)).."]' WHERE `players`.`id`= " .. coNdConf.pid .. ";" --=[Reseta]=-- function addValue(value) if coNdConf.look == false then doRemoveCreature(cid) db.executeQuery(lvl_query);db.executeQuery(reset_query);db.executeQuery(nolook_query) else doRemoveCreature(cid) db.executeQuery(lvl_query);db.executeQuery(reset_query);db.executeQuery(look_query) return LUA_NO_ERROR end end function nowReseting() if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -") return true end if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then doPlayerPopupFYI(cid, success) addEvent(addValue, coNdConf.resetConf.time*1, value) else doPlayerPopupFYI(cid, success) addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid))) addEvent(addValue, coNdConf.resetConf.time*1000, value) return true end end --[sTAGES Nao mexer em nada.]-- function checkLevelStageReset(cid) local stages = { {resets= stage.stage1.resets, premmy= stage.stage1.premmy, free= stage.stage1.free}, {resets= stage.stage2.resets, premmy= stage.stage2.premmy, free= stage.stage2.free}, {resets= stage.stage3.resets, premmy= stage.stage3.premmy, free= stage.stage3.free}, {resets= stage.stage4.resets, premmy= stage.stage4.premmy, free= stage.stage4.free}, {resets= stage.stage5.resets, premmy= stage.stage5.premmy, free= stage.stage5.free}, {resets= stage.stage6.resets, premmy= stage.stage6.premmy, free= stage.stage6.free}, {resets= stage.stage7.resets, premmy= stage.stage7.premmy, free= stage.stage7.free}, {resets= stage.stage8.resets, premmy= stage.stage8.premmy, free= stage.stage8.free}, {resets= stage.stage9.resets, premmy= stage.stage9.premmy, free= stage.stage9.free}, {resets=stage.stage10.resets, premmy=stage.stage10.premmy, free=stage.stage10.free}, {resets=stage.stage11.resets, premmy=stage.stage11.premmy, free=stage.stage11.free}, {resets=stage.stage12.resets, premmy=stage.stage12.premmy, free=stage.stage12.free}, {resets=stage.stage13.resets, premmy=stage.stage13.premmy, free=stage.stage13.free}, {resets=stage.stage14.resets, premmy=stage.stage14.premmy, free=stage.stage14.free}, {resets=stage.stage15.resets, premmy=stage.stage15.premmy, free=stage.stage15.free}, {resets=stage.stage16.resets, premmy=stage.stage16.premmy, free=stage.stage16.free}, {resets=stage.stage17.resets, premmy=stage.stage17.premmy, free=stage.stage17.free}, {resets=stage.stage18.resets, premmy=stage.stage18.premmy, free=stage.stage18.free}, {resets=stage.stage19.resets, premmy=stage.stage19.premmy, free=stage.stage19.free}, {resets=stage.stage20.resets, premmy=stage.stage20.premmy, free=stage.stage20.free}, {resets=stage.stage21.resets, premmy=stage.stage21.premmy, free=stage.stage21.free}, {resets=stage.stage22.resets, premmy=stage.stage22.premmy, free=stage.stage22.free}, {resets=stage.stage23.resets, premmy=stage.stage23.premmy, free=stage.stage23.free}, {resets=stage.stage24.resets, premmy=stage.stage24.premmy, free=stage.stage24.free}, {resets=stage.stage25.resets, premmy=stage.stage25.premmy, free=stage.stage25.free}, {resets=stage.stage26.resets, premmy=stage.stage26.premmy, free=stage.stage26.free}, {resets=stage.stage27.resets, premmy=stage.stage27.premmy, free=stage.stage27.free}, } local resets = getPlayerReset(cid) for i, tab in ipairs(stages) do if resets <= tab.resets then coNdConf.resetConf.Level = isPremium(cid) and tab.premmy or tab.free break end end if (getPlayerLevel(cid) < coNdConf.resetConf.Level) then err(cid, MESSAGE_STATUS_CONSOLE_BLUE, "- Level Necessário Para o Reset ["..coNdConf.resetConf.Level.."]. Faltam "..coNdConf.resetConf.Level-getPlayerLevel(cid).." level's para você Resetar. -") return TRUE end if getPlayerLevel(cid) >= coNdConf.resetConf.Level and (coNdConf.teleport == false) then doPlayerPopupFYI(cid, success) addEvent(addValue, coNdConf.resetConf.time*1000, value) else doPlayerPopupFYI(cid, success) addEvent(addValue, coNdConf.resetConf.time*1000, value) addEvent(doTeleportThing, coNdConf.resetConf.time*900, cid, getTownTemplePosition(getPlayerTown(cid))) return true end end function newReset(cid) if(coNdConf.needPz == true) and (getTilePzInfo(getCreaturePosition(cid)) == LUA_ERROR) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar em Protection Zone Para Resetar. -") return TRUE end if(coNdConf.needPa == true) and not isPremium(cid) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa ser Premium Account para Resetar. -") return TRUE end if(coNdConf.withe == false) and (getCreatureSkullType(cid) == 3) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Withe. -") return TRUE end if(coNdConf.red == false) and (getCreatureSkullType(cid) == 4) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você não pode resetar em condições de PK Red. -") return TRUE end if(coNdConf.battle == true) and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then err(cid,MESSAGE_STATUS_CONSOLE_BLUE,"- Você Precisa estar sem Battle para Resetar. -") return TRUE end local xy = {true,false} table.insert(stage.Abilitar, false) table.insert(stage.Desabilitar, false) if stage.Abilitar[1] == xy[1] and stage.Desabilitar[1] == xy[2] then checkLevelStageReset(cid) elseif stage.Abilitar[1] == xy[2] and stage.Desabilitar[1] == xy[1] then nowReseting() else doPlayerPopupFYI(cid, "LUA_ERROR; Configure corretamente o Sistema de STAGES!") end return true end function tableResetInstall() print(not rss_db and LUA_ERROR or "Tabela de Resets: Instalada ... [success] ") addEvent(newReset, 1000, cid) return false end if tableResetInstall() then end end --=[install System]=-- function installReset() if db.executeQuery("ALTER TABLE `players` ADD reset INT(11) NOT NULL DEFAULT 0;") then print("[MarcelloMkez] -= Advanced Reset System 2.0 por DataBase =- Instalado com sucesso!") return TRUE end print('[Advanced Reset System/MarcelloMkez] Não foi possível instalar o Sistema.') return FALSE end local tt = { "Preparando Instalação...", "Instalando: TableReset Db...", "Instalando: getPlayerReset()...", "Instalando: addValue()...", "Instalando: checkLevelStageReset()...", "Instalando: newReset() and nowReseting()...", "Finalizando Instalação...", "...", success = { "Iniciando...", "function: TableReset Db... [success]", "function: getPlayerReset()... [success]", "function: addValue(value)... [success]", "function: checkLevelStageReset()... [success]", "function: newReset() and nowReseting()... [success]", "Fim da Instalação. ", "by: ~~ MarcelloMkez ~~ \nContato: marcello_dirt@@Hotmail.com", inst = {"MarcelloMkez","Advanced Reset System 2.0 por DataBase" }, }, } if words == "/installresetguiizeera" and getPlayerAccess(cid) >= 3 then function install() if installReset() then print(""..tt.success[7].."") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,""..tt.success[8].."") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] -="..tt.success.inst[2].."=- Instalado com sucesso!") else print("["..tt.success.inst[1].."] FALHA NA INSTALAÇÃO! [O sistema ja foi instalado].") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "["..tt.success.inst[1].."] FALHA NA INSTALAÇÃO! [O sistema ja foi instalado].") end return 1 end function concl(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[7].."") print(""..tt[8].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[7].."") doPlayerSendTextMessage(cid, typetx,""..tt[8].."") addEvent(install, 1000,cid) end function finall(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[6].."") print(""..tt[7].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[6].."") doPlayerSendTextMessage(cid, typetx,""..tt[7].."") addEvent(concl, 3000,cid) end function installDd(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[5].."") print(""..tt[6].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[5].."") doPlayerSendTextMessage(cid, typetx,""..tt[6].."") addEvent(finall, 1000,cid) end function installCc(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[4].."") print(""..tt[5].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[4].."") doPlayerSendTextMessage(cid, typetx,""..tt[5].."") addEvent(installDd, 1000,cid) end function installBb(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[3].."") print(""..tt[4].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[3].."") doPlayerSendTextMessage(cid, typetx,""..tt[4].."") addEvent(installCc, 1000,cid) end function installAa(cid) local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[2].."") print(""..tt[3].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[2].."") doPlayerSendTextMessage(cid, typetx,""..tt[3].."") addEvent(installBb, 1000,cid) end function toInstall() local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt.success[1].."") print(""..tt[2].."") doPlayerSendTextMessage(cid, typetx,""..tt.success[1].."") doPlayerSendTextMessage(cid, typetx,""..tt[2].."") addEvent(installAa, 1000,cid) end function preparation() local typetx = MESSAGE_STATUS_CONSOLE_BLUE print(""..tt[1].."") doPlayerSendTextMessage(cid, typetx,""..tt[1].."") addEvent(toInstall, 3000,cid) end if preparation() then end end return 1 end --=[by: Juniior Cwb ;* ]=--
-
Eu coloco para chegar 5kk no meu gesior, mas só chega 1kk alguém sabe como colocar para vim o resto? local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGElocal SQL_interval = 30 function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do local id = tonumber(result_plr:getDataInt("id")) local action = tostring(result_plr:getDataString("action")) local delete = tonumber(result_plr:getDataInt("delete_it")) local cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "aid", getPlayerGUID(cid)+10000) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return trueend
-
Tenho esse script de dominar cidades feito pelo zipster98, algo assim, alias muito obrigado... Mas queria mudar 2 coisas q me faltam conhecimento, alguem mais experiente poderia me ajudar? Scripts: /lib/GOTlib.lua cityMonsters = { --["monster_name"] = recomendo número anterior + 1, ["Chanceler Carlin"] = 1, ["Chanceler Venore"] = 2, ["Chanceler Thais"] = 3, ["Chanceler Darashia"] = 4, ["Chanceler Ankrahmun"] = 5, ["Chanceler Edron"] = 6, ["Chanceler Rookgaard"] = 7, ["Chanceler Svargrond"] = 8, --etc}DEFAULT_STORAGE = 49198function setGuildExperience(guildId, exp) for _, pid in pairs(getPlayersOnline()) do if getPlayerGuildId(pid) == guildId then doPlayerSetExperienceRate(pid, exp) end endendfunction getGuildExpRate(guildId) for _, pid in pairs(getPlayersOnline()) do local playerRate = getPlayerRates(pid)[8] if getPlayerGuildId(pid) == guildId and playerRate > 1 then return playerRate end end return 1.0endfunction getGuildName(guild_id) --Omega local query = db.getResult("SELECT name FROM guilds WHERE id = "..guild_id) local ret = query:getID() == -1 and false or query:getDataString("name") print(query:getDataString("name")) query:free() return retend Monster exemple: <monster name="Chanceler Carlin" file="GOT/chanceler carlin.xml"/> <?xml version="1.0" encoding="UTF-8"?><monster name="Chanceler Carlin" nameDescription="Chanceler Carlin" race="blood" experience="0" speed="0" manacost="0"> <health now="6" max="6"/> <look type="140" head="0" body="0" legs="0" feet="0" addons="3" corpse="6080"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> </flags> <attacks> <attack name="melee" interval="2000" skill="45" attack="20"/> </attacks> <defenses armor="9" defense="11"> <defense name="healing" interval="1000" chance="9" min="750" max="1250"> <attribute key="areaEffect" value="blueshimmer"/> </defense> <defense name="healing" interval="1000" chance="17" min="300" max="500"> <attribute key="areaEffect" value="blueshimmer"/> </defense> </defenses> <immunities> <immunity lifedrain="1"/> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <voices interval="5000" chance="10"> <voice sentence="Guards!" yell="1"/> </voices> <script> <event name="mDeath"/> </script></monster> <movevent type="StepIn" actionid="12000-12100" event="script" value="GOT/throne_capturing.lua"/> <movevent type="StepIn" actionid="2391-2398" event="script" value="GOT/tile_acess_members_of_throne.lua"/> /movemments/throne_capturing.lua local config = { level = 50, count = 5, messages = { [12000] = "[GOT]The guild %s is entering the castle.", [12001] = "[GOT]The guild %s is already inside the castle.", [12002] = "[GOT]The guild %s is close to conquer the castle." }, actionId = {12000, 4819}}function tableInsert(table, value) -- technically this doesn't need to be #table + 1, it can just be #table table[#table + 1] = valueendfunction onStepIn(cid, item, position, fromPosition) local pid, ip = {}, {} -- now they will hold the values generated by get getGuildOnlineMembers local function getGuildOnlineMembers(guildId) for _, cid in pairs(getPlayersOnline()) do if getPlayerGuildId(cid) == guildId and getPlayerLevel(cid) >= config.level and not isInArray(ip, getPlayerIp(cid)) then tableInsert(pid, cid) tableInsert(ip, getPlayerIp(cid)) end end return pid end if not isPlayer(cid) then return true end if item.actionid == config.actionId[1] then if getPlayerGuildId(cid) < 1 or #getGuildOnlineMembers(getPlayerGuildId(cid)) < config.count then doPlayerSendCancel(cid, "You need to be on guild or your guild must have at least "..config.count.." players level "..config.level.." or more.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) doTeleportThing(cid, fromPosition, true) return true end end if getGlobalStorageValue(item.actionid + config.actionId[2]) < os.time() then broadcastMessage(config.messages[item.actionid]:format(getPlayerGuildName(cid))) setGlobalStorageValue(item.actionid + config.actionId[2], os.time() + 10) end doCreatureSetSkullType(cid, 3) return trueend /movemments/tile_acess_members_of_throne.lua local guilds = { --[actionid] = número da cidade configurado em cityMonsters, [2391] = 1, [2392] = 2, [2393] = 3, [2394] = 4, [2395] = 5, [2396] = 6, [2397] = 7, [2398] = 8,} function onStepIn(cid, item, position, fromPosition) if not isPlayer(cid) then return true end local guildId = getGlobalStorageValue(guilds[item.actionid] + DEFAULT_STORAGE) if getPlayerGuildId(cid) ~= guildId then doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, 'This territory is not of your Guild') end return trueend CreatureScripts <!-- Guild own throne +25%de exp --> <event type="death" name="mDeath" event="script" value="GOT/expbonus_got.lua"/> <event type="statschange" name="mStatsChange" event="script" value="GOT/expbonus_got.lua"/> <event type="target" name="mTarget" event="script" value="GOT/expbonus_got.lua"/> <event type="login" name="mLogin" event="script" value="GOT/expbonus_got.lua"/> /creaturescripts/scripts/expbonus_got.lua function onTarget(cid, target) local m, playerGuild = cityMonsters[getCreatureName(target)], getPlayerGuildId(cid) if isPlayer(cid) and isMonster(target) and m and playerGuild > 0 then return getGlobalStorageValue(DEFAULT_STORAGE + m) ~= playerGuild end return trueendfunction onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and isMonster(cid) and type == STATSCHANGE_HEALTHLOSS then local m, playerGuild = cityMonsters[getCreatureName(cid)], getPlayerGuildId(attacker) if m and playerGuild > 0 then return getGlobalStorageValue(DEFAULT_STORAGE + m) ~= playerGuild end end return trueendfunction onLogin(cid) local guildId = getPlayerGuildId(cid) if guildId > 0 and getGuildExpRate(guildId) > 1 then doPlayerSetExperienceRate(cid, getGuildExpRate(guildId)) end registerCreatureEvent(cid, "mTarget") registerCreatureEvent(cid, "mStatsChange") return trueend function onDeath(cid, corpse, deathList) local killer, m = deathList[1], cityMonsters[getCreatureName(cid)] if killer and isPlayer(killer) and m then local atualGuild, playerGuild = getPlayerStorageValue(cid, DEFAULT_STORAGE + m), getPlayerGuildId(killer) if playerGuild > 0 and atualGuild ~= playerGuild then if atualGuild > -1 then setGuildExperience(atualGuild, getGuildExpRate(atualGuild) - 0.25) end setGuildExperience(playerGuild, getGuildExpRate(playerGuild) + 0.25) setGlobalStorageValue(DEFAULT_STORAGE + m, playerGuild) broadcastMessage("The guild "..getPlayerGuildName(killer).."just dominate the throne of"..getCreatureName(cid):explode(" ")[2].."!") end end return trueend Preciso de ajuda com duas coisas: 1- Como fazer pra fazer cancelamentos se já tiver um territorio Como por exemplo: function onTarget(cid, target) if SUAGUILDA TEM ALGUM TERRITORIO CANCELA O ATK DIZENDO QUE SUA GUILDA JA TEM UM TERRITORIO end local m, playerGuild = cityMonsters[getCreatureName(target)], getPlayerGuildId(cid) if isPlayer(cid) and isMonster(target) and m and playerGuild > 0 then return getGlobalStorageValue(DEFAULT_STORAGE + m) ~= playerGuild end return trueend if SUAGUILDA TEM ALGUM TERRITORIO doPlayerSendCancel(cid, "Your guild already has a throne dominated! Only one per guild.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) doTeleportThing(cid, fromPosition, true) return true end 2- Como fazer uma placa pra eu colocar em frente de cada castelo, que quando os caras derem look aparecesse o nome da guilda dominante? Sei la algo como esse pseudo codigo onlook item sing value = NAOSEI local guildName = getGuildName(getGlobalStorageValue(value)) if guildName then "City owned by guild"..guildName.."!" else "No one guild own this city!" end