Ir para conteúdo

xWhiteWolf

Héroi
  • Registro em

  • Última visita

Tudo que xWhiteWolf postou

  1. xWhiteWolf respondeu ao post em um tópico de macalo em Suporte Tibia OTServer
    duas talkactions estão como /ban no talkactions.xml.. é só ler o erro que ele tá falando exatamente oque tá de errado.
  2. para de dar up, eu vou tentar fazer esse fim de semana.. se eu conseguir eu posto aqui.
  3. acho que o erro não é no meu script não.. por dois motivos: 1- eu testei 2- o erro que tá dando é na linha 197, no meu script (se vc tiver copiado tudo certo) a linha 197 é uma linha em branco. em todo caso eu tirei os comentários desnecessários, copia e cola dnv e COLOCA O MESMO NOME QUE EU FALEI --[[Script made 100% by Nogard and Night Wolf. You can feel free to edit anything you want, but don't remove the credits]] local config = { minlevel = 700, --- level inical para resetar price = 10000, --- preço inicial para resetar newlevel = 20, --- level após reset priceByReset = 10000, --- preço acrescentado por reset mlnew = 20, --- quanto de ml vai adicionar ao resetar skillnew = 25 --- quanto de skill vai dar (axe, club, sword, shield, distance) } --- end config function addReset(cid) resets = getResets(cid) setPlayerStorageValue(cid, 378378, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) ------------------------------------ MUDE AQUI A % DE VIDA QUE GANHA AO RESETAR --------------------- local hp = getCreatureMaxHealth(cid) local resethp = hp*0.25 setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*0.25 setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) ------------------------------------ FIM ---------------------------- doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..resets.."]' WHERE `players`.`id` = "..playerid) db.executeQuery("UPDATE `players` SET `level` = "..config.newlevel..", `experience` = 0 WHERE `id` = "..playerid) return TRUE end function getResets(cid) resets = getPlayerStorageValue(cid, 378378) if resets < 0 then resets = 0 end return resets end local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local newPrice = config.price + (getResets(cid) * config.priceByReset) if msgcontains(msg, 'reset') then if getResets(cid) == resets then selfSay('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('I couldnt acess your bank of acess!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < newPrice then selfSay('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) elseif getPlayerLevel(cid) < config.minlevel then selfSay('The minimum level for reseting is '..config.minlevel..'!', cid) else doPlayerRemoveMoney(cid,newPrice) playerid = getPlayerGUID(cid) addEvent(addReset, (5*1000), cid) local msg ="---[Reset: "..getResets(cid).."]-- You have reseted! You'll be disconnected in 5 seconds." if doPlayerPopupFYI(cid, msg) then end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 selfSay('Ok.', cid) elseif msgcontains(msg, 'quantity') then selfSay('You have a total of '..getResets(cid)..' reset(s).', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  4. Reseter.xml <npc name="Reseter" script="data/npc/scripts/reset.lua" access="5" lookdir="1"> <health now="1000" max="1000"/> <look type="133" head="95" body="86" legs="86" feet="38" addons="3"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME|.I've been waiting for you to come.. Say 'reset' or 'quantity'" /> </parameters> </npc> reset.lua --[[Script made 100% by Nogard and Night Wolf. You can feel free to edit anything you want, but don't remove the credits]] local config = { minlevel = 700, --- level inical para resetar price = 10000, --- preço inicial para resetar newlevel = 20, --- level após reset priceByReset = 10000, --- preço acrescentado por reset mlnew = 20, --- quanto de ml vai adicionar ao resetar skillnew = 25 --- quanto de skill vai dar (axe, club, sword, shield, distance) } --- end config function addReset(cid) resets = getResets(cid) setPlayerStorageValue(cid, 378378, resets+1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) ------------------------------------ MUDE AQUI A % DE VIDA QUE GANHA AO RESETAR --------------------- local hp = getCreatureMaxHealth(cid) local resethp = hp*0.25 setCreatureMaxHealth(cid, resethp) local differencehp = (hp - resethp) doCreatureAddHealth(cid, -differencehp) local mana = getCreatureMaxMana(cid) local resetmana = mana*0.25 setCreatureMaxMana(cid, resetmana) local differencemana = (mana - resetmana) doCreatureAddMana(cid, -differencemana) ------------------------------------ FIM ---------------------------- ------------------------------ EDIÇÃO DAS SKILLS -------------------- --TENTATIVA NUMERO 1 --[[local skills = { magic = getPlayerSkillLevel(cid, SKILL__MAGLEVEL), club = getPlayerSkillLevel(cid, SKILL_CLUB), axe = getPlayerSkillLevel(cid, SKILL_AXE), sword = getPlayerSkillLevel(cid, SKILL_SWORD), shield = getPlayerSkillLevel(cid, SKILL_SHIELD), distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) } local amountclub = (skills.club + skillnew) local amountaxe = (skills.axe + skillnew) local amountsword = (skills.sword + skillnew) local amountshield = (skills.shield + skillnew) local amountdistance = (skills.distance + skillnew) local requiredclub = getPlayerRequiredSkillTries(cid, SKILL_CLUB, amountclub) local requiredaxe = getPlayerRequiredSkillTries(cid, SKILL_AXE, amountaxe) local requiredsword = getPlayerRequiredSkillTries(cid, SKILL_SWORD, amountsword) local requiredshield = getPlayerRequiredSkillTries(cid, SKILL_SHIELD, amountshield) local requireddistance = getPlayerRequiredSkillTries(cid, SKILL_DISTANCE, amountdistance) doPlayerAddSkillTry(cid, SKILL_CLUB, requiredclub) doPlayerAddSkillTry(cid, SKILL_AXE, requiredaxe) doPlayerAddSkillTry(cid, SKILL_SWORD, requiredsword) doPlayerAddSkillTry(cid, SKILL_SHIELD, requiredshield) doPlayerAddSkillTry(cid, SKILL_DISTANCE, requireddistance) --TENTATIVA NUMERO 2 local club = getPlayerSkillLevel(cid, SKILL_CLUB) local sword = getPlayerSkillLevel(cid, SKILL_SWORD) local axe = getPlayerSkillLevel(cid, SKILL_AXE) local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) if isInArray({1,5,2,6}, getPlayerVocation(cid)) then db.executeQuery("UPDATE `players` SET `level`="..config.newlevel..",`experience`="..config.newexp..",`maglevel` = `maglevel` + ".. config.newml ..",`manamax`= " .. (resetmana) .. ",`healthmax`= " .. (resethp) .. " WHERE `players`.`id`= ".. playerid .."") end if isInArray({4,8}, getPlayerVocation(cid)) then local club = getPlayerSkillLevel(cid, SKILL_CLUB) local sword = getPlayerSkillLevel(cid, SKILL_SWORD) local axe = getPlayerSkillLevel(cid, SKILL_AXE) local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) db.executeQuery("UPDATE `player_skills` SET `value` = " .. (shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (axe + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 3 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (sword + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 2 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (club + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 1 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `players` SET `level`="..config.newlevel..",`experience`="..config.newexp..",`manamax`= " .. (resetmana) .. ",`healthmax`= " .. (resethp) .. " WHERE `players`.`id`= ".. playerid .."") end if isInArray({3,7}, getPlayerVocation(cid)) then local distance = getPlayerSkillLevel(cid, SKILL_DISTANCE) local shield = getPlayerSkillLevel(cid, SKILL_SHIELD) db.executeQuery("UPDATE `player_skills` SET `value` = " .. (shield + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 5 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `player_skills` SET `value` = " .. (distance + config.skillnew) .. ", `count` = 0 WHERE `skillid` = 4 and `player_id` = " .. playerid .. ";") db.executeQuery("UPDATE `players` SET `level`="..config.newlevel..",`experience`="..config.newexp..",`manamax`= " .. (resetmana) .. ",`healthmax`= " .. (resethp) .. " WHERE `players`.`id`= ".. playerid .."") end --TENTATIVA NUMERO 3 doPlayerAddSkillTry(cid, 1, 90) doPlayerAddSkillTry(cid, 2, 90) doPlayerAddSkillTry(cid, 3, 90) doPlayerAddSkillTry(cid, 4, 90) doPlayerAddSkillTry(cid, 5, 90) doPlayerAddSkillTry(cid, 7, 90) OBS: NENHUMA DESSAS FUNÇÕES FOI CAPAZ DE ADICIONAR SKILL AO PERSONAGEM ]] ------------------------FIM ---------------------------------- doRemoveCreature(cid) db.executeQuery("UPDATE `players` SET `description` = ' [Reset: "..resets.."]' WHERE `players`.`id` = "..playerid) db.executeQuery("UPDATE `players` SET `level` = "..config.newlevel..", `experience` = 0 WHERE `id` = "..playerid) return TRUE end function getResets(cid) resets = getPlayerStorageValue(cid, 378378) if resets < 0 then resets = 0 end return resets end local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local newPrice = config.price + (getResets(cid) * config.priceByReset) if msgcontains(msg, 'reset') then if getResets(cid) == resets then selfSay('You want to reset your character? It will cost '..newPrice..' gp\'s!', cid) talkState[talkUser] = 1 else selfSay('I couldnt acess your bank of acess!', cid) end elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerMoney(cid) < newPrice then selfSay('Its necessary to have at least '..newPrice..' gp\'s for reseting!', cid) elseif getPlayerLevel(cid) < config.minlevel then selfSay('The minimum level for reseting is '..config.minlevel..'!', cid) else doPlayerRemoveMoney(cid,newPrice) playerid = getPlayerGUID(cid) addEvent(addReset, (5*1000), cid) local msg ="---[Reset: "..getResets(cid).."]-- You have reseted! You'll be disconnected in 5 seconds." if doPlayerPopupFYI(cid, msg) then end end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and isInArray({1}, talkState[talkUser]) == TRUE then talkState[talkUser] = 0 selfSay('Ok.', cid) elseif msgcontains(msg, 'quantity') then selfSay('You have a total of '..getResets(cid)..' reset(s).', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) OBS: Não consegui fazer a parte de adicionar skills como você pediu e deixei a % da vida sendo 25% pra ser mais legalzinho. OBS2: Agradeça eternamente o Nogard e faça tudo que ele mandar de agora em diante porque ele se dipôs a ficar até as 8:32 da manhã conversando comigo e me ajudando nesse script aqui.
  5. cara, tá escrito if not isPaladin(cid) then só tira esse not da frente que resolve o seu problema. Repete esse mesmo passo pra Knight, Drunou e etc. Outra coisa: vc tem que garantir que o seu server possui essa função isDrunou.. caso não existe substitui if not isDrunou(cid) then por if isInArray({NUMERO DA CLASSE}, getPlayerVocation(cid)) then no numero da classe coloca o NUMERO DA CLASSE kkk vc pode ver isso na vocations.xml dentro do seu server. Boa Sorte
  6. leia a minha resposta nesse tópico, ele pediu praticamente a mesma coisa. http://www.tibiaking.com/forum/topic/31450-pedido-editar-items/
  7. o ruim do método do script é que, na melhor das hipóteses, vc teria que fazer 4 tipos de scripts diferentes pra cada direção. Isso na melhor das hipóteses, na pior você teria que fazer um script diferente pra cada porta do trainer. É muito mais útil (poupa memória do seu server e facilita o RPG) fazer da forma que eu falei antes. Se você me permite, ainda diria que dá pra fazer uns trainers bem locos baseados em monstros de acordo com a parte do mapa (como fazer um stand de tiro pra paladins no meio da floresta e um piso que quando o knight pisa ele sumona um monte de black knights (trainers) em volta pra treinar tanto skill de weapon como de shield. Eu ficaria muito feliz em te ajudar, mas só se fosse pra gente fazer algo que valesse a pena perder tempo fazendo.
  8. eu não entendo o motivo de você querer um sistema de ban tão complexo, é realmente necessário no seu servidor banir pessoas? manualmente ainda??? Na minha época OT's eram pra ser divertidos e a complexidade era justamente tornar o OT inovador pra todos os gostos. Se eu fosse você eu pediria um sistema de ban assim, se o player tiver warning e vestir algum item super foda ele é banido por 1 dia: Não importa oque ele tenha feito de errado, ele vai ter 24 hrs pra pensar OU criar a culpa sobre si mesmo de qualquer coisa que ele possa ter pensado em fazer de errado.
  9. só li hoje isso, perdão. Não sei como funciona o seu sistema de reset, a cada reset ele adiciona +1 no valor do storage? Se for isso é só usar function onUse(cid, item, fromPosition, itemEx, toPosition) local ml = getPlayerMagLevel(cid) local lvl = getPlayerLevel(cid) -------edite a formula aqui--------- formulafor = math.random(((lvl+ml)*5)-(lvl+ml)) --formula forte, vai ser a mesma pra Vida de Knight e Mana de Sorc/Druid formulafra = math.random(((lvl+ml)*2)-(lvl+ml)) --formula fraca, pra mana de knight e vida de sorc/druid formulamed = math.random(((lvl+ml)*3)-(lvl+ml)) --formula média para paladins que usam tanto vida quanto mana -------------------------------------------- local storage = getPlayerStorageValue(cid,85987) --- digite o storage aqui if itemEx.itemid == 1 and isPlayer(itemEx.uid) == TRUE and storage == 1 then --checa o valor do storage (no caso tem que ser igual a 1 pra usar a pot if isSorcerer(itemEx.uid) or isDruid(itemEx.uid) then doSendMagicEffect(getThingPos(itemEx.uid), 1) doPlayerAddMana(itemEx.uid,formulafor) doCreatureAddHealth(itemEx.uid,formulafra) elseif isKnight(itemEx.uid) then doSendMagicEffect(getThingPos(itemEx.uid), 1) doPlayerAddMana(itemEx.uid,formulafra) doCreatureAddHealth(itemEx.uid,formulafor) elseif isPaladin(itemEx.uid) then doSendMagicEffect(getThingPos(itemEx.uid), 1) doPlayerAddMana(itemEx.uid,formulamed) doCreatureAddHealth(itemEx.uid,formulamed) end if item.type > 1 then doChangeTypeItem(item.uid,item.type-1) else doRemoveItem(item.uid,1) end end if storage < 1 then --se o storage for menor que 1 ele vai dar essa mensagem de erro doPlayerSendCancel(cid,"You can only use this potion if you have already reseted.") doSendMagicEffect(getThingPos(item.uid), 2) end if isPlayer(itemEx.uid) == FALSE then doPlayerSendCancel(cid,"You can only use this rune in you or in players.") doSendMagicEffect(getThingPos(item.uid), 2) end return 1 end Perceba que adicionei duas coisas novas no script. Se o seu sistema de reset for daqueles que a cada vez que o player reseta adiciona +1 no valor do storage (EX: Começa 0, dai o player reseta e vira 1, dps reseta dnv e se torna 2 e assim por diante) é só colocar na mensagem de erro caso for menor que a quantidade de resets que você queira e ali em cima no if storage == 1 vc muda pro valor de quantos resets o player deve ter pra usar aquilo. Qualquer dúvida me manda PM ou posta aqui ou ambos. uhauhauh
  10. Actions são ações relacionadas à coisas paradas (clicar em itens, alavancas e afins) Movements são ações de movimento tais como: andar, equipar itens. Creaturescripts são ações relacidas à criaturas: matar, morrer, logar, deslogar. É mais provavel que esse script esteja em creaturescripts; Mods são ações relacionadas à tudo e eu ainda não entendi porque eles existem euhuheuhe mas acho que fizeram pra combinar as funções de movements, actions, creature scripts e outras coisinhas a mais. Eu ando meio ocupado por causa da faculdade mas me manda um PM aí que a gente conversa
  11. xWhiteWolf respondeu ao post em um tópico de Nogard em Formação de Equipe
    adorei a ideia de fazer um servidor baseado em SuperNatural, as magias devem ser muito loucas.
  12. eu tive todo o trabalho do mundo pra escrever esse post e eu te garanto que ele tá todo certinho, vc tem que adicionar essa linha no items.xml na parte da bota <attribute key="magiclevelpoints" value="1" /> e dps colocar o id dela no movements do mesmo jeito que citei anteriormente
  13. storagesDuel = {52480, 52481, 52482, 52482, 52483, 52484, 52485, 6598754} for i = 1, #storagesDuel do if (getPlayerStorageValue(cid,storagesDuel[i])) == 1 then setPlayerStorageValue(cid, storagesDuel[i], 0) end acho que é isso
  14. deve estar no creaturescripts.xml function onLogin, se não for isso pode estar em "mod" (pasta do servidor diferente da data) ou na próprias sources. Dá uma olhada também no seu global.lua pra ver se não tem nada falando em Rates e em showRates algo do tipo
  15. ah, vc quer tirar? pensei que vc queria colocar KKKKK então faz assim, vai no seu creaturescripts.xml e procura algo relacionado a outfit ou andar. Se possível copia e cola tudo que tá escrito no seu creaturescripts.xml que eu tento te ajudar
  16. <attribute key="healthGain" value="100" /> <attribute key="healthTicks" value="3000" /> <attribute key="manaGain" value="200" /> <attribute key="manaTicks" value="3000" /> ticks é o tempo em milisegundos e healthgain e mana gain é o quanto recupera de vida/mana. (ISSO NO ITEMS.XML) DAI VC ABRE O MOVEMENTS.XML E COLOCA ISSO <movevent type="Equip" itemid="ID DO SEU HELMET" slot="head" level="40" event="function" value="onEquipItem"> <vocation id="1"/> <vocation id="5" showInDescription="0"/> <vocation id="2"/> <vocation id="6" showInDescription="0"/> </movevent> <movevent type="DeEquip" itemid="ID DO SEU HELMET" slot="head" event="function" value="onDeEquipItem"/> itemid: coloca o id do item slot: tipo de lugar que vai ativar o efeito (nesse caso, se vc colocar o helmet em qualquer slot que não seja a cabeça não ativa) level: level pra usar o item event e value: não mexe vocation id é as classes que podem usar, o showIndescription = 0 indica que não vai mostrar aquela classe na descrição (isso serve pra evitar repetições do tipo: Esse item pode ser usado por sorceres e master sorceres)
  17. eu to sem nenhum ot pra testar isso pra ti agora e por enquanto eu to totalmente sem tempo.
  18. não precisa de um script, é só editar o mapa (remove as portas) e colocar pz em tudo (menos dentro do trainer). Só vai poder entrar um :~
  19. TODOS OS CRÉDITOS DISSO VÃO PARA O MEMBRO CAOTIC DE OUTRO FÓRUM "ae galeerrra 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); 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);} 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: 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: <!-- TV --> <action itemid="1445" event="script" value="tv.lua"/> 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"/>
  20. sobre a primeira: use getCreatureMaxHealth e getPlayerMaxMana e salve num storage a quantidade de vezes que ja resetou pra que o preço aumente. Dps é só setar o level 20, e 15% dos get'sCreatureMaxHealth/Mana. Com alguns if's isSorcerer/isKnight/isPaladin/isDruid você pode ir brincando do jeito que vc quiser. Pra nova moeda é só modificiar no itens.xml pra ruby ser coin, mudar a action que qnd vc clica em 100 crystals ela vire uma ruby e mudar manualmente todos os Npc's do jogo. Procura no google sobre golden nugget que é capaz de achar esse sistema todo pronto já só que ao invés de ser pra ruby ser pro golden nugget, dai vc edita a seu critério
  21. xWhiteWolf respondeu ao post em um tópico de manolodede em Suporte Tibia OTServer
    use o search ou procure no google, é mais simples cara
  22. o respaw só dá se nao tiver player na tela (a menos que vc seja GM/GOD e afins)
  23. isso está acima das minhas capacidades kkk espera eu me formar que eu tento fazer pra ti porque por ora eu só sei Lua, isso dai teria que mexer nas sources :~
  24. creaturescripts/scripts/outfit.lua --[[CRÉDITOS VÃO TODOS PARA AnneMotta & Vodkart POR TEREM CRIADO O SCRIPT, EU APENAS EDITEI O SCRIPT DO JEITO QUE VC PEDIU ]] function onLogin(cid) registerCreatureEvent(cid, "EffectOutLogin") registerCreatureEvent(cid, "OutfitEffects") return doCreatureChangeOutfit(cid,{lookType = getCreatureOutfit(cid).lookType, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet, lookAddons = getCreatureOutfit(cid).lookAddons}) end local events = {} function onOutfit(cid, old, current) -------------------------------------------- CONFIGURE ABAIXO------------------------------------------ local effect = { [535] = 4, [356] = 2 --para adicionar mais outfits e eventos apenas coloque uma virgula depois do 4 e siga o padrão. } local tempo = 1500 --tempo entre 1 efeito e outro em milisegundos -------------------------------------------FIM DA CONFIGURAÇÃO --------------------------------------- local o,c= effect[old.lookType],effect[current.lookType] if getPlayerAccess(cid) > 2 then return true elseif (not o or not c or o) then stopEvent(events[getPlayerGUID(cid)]) end if c then function WalkEffect(cid, c, pos) if not isCreature(cid) then return LUA_ERROR end if c then frompos = getThingPos(cid) doSendMagicEffect(frompos, c) events[getPlayerGUID(cid)] = addEvent(WalkEffect, tempo, cid, c, frompos) end return true end WalkEffect(cid, c, {x=0, y=0, z=0}) end return true end e em creaturescripts.xml coloque isso <event type="login" name="EffectOutLogin" event="script" value="outfiteffect.lua"/> <event type="outfit" name="OutfitEffects" event="script" value="outfiteffect.lua"/> Ali você configura basicamente tudo que vc quiser, mudando um if vc consegue colocar pra só sair o efeito quando andar.. boa sorte.
  25. explica oque é um "Cast System" que eu vejo oque dá pra fazer

Informação Importante

Confirmação de Termo