kaleudd 200 Postado Janeiro 8, 2016 Share Postado Janeiro 8, 2016 Bom galera com muita gente quer o tal cast tv está ai, LEMBRADO É SISTEMA REPLICA DO PARAGUAI , ENTÃO BOM USO Versão testada: TFS 8.6 0.4 e TFS 0.3.6 8.6 Comandos utilizados in-game: !cast on -- Ativa o seu Cast System, e permite os outros jogadores te assistirem; !cast off -- Desativa o seu Cast System; !cast exit -- Você sai do Cast no qual está assistindo; !cast NAME -- Começa a assistir um jogador (NAME). Instalação: Vá em data/talkactions/scripts crie um arquivo chamado castSys.lua e adicione o seguinte código dentro do mesmo: --[[ Perfect Cast System 1.0 by Roksas ]]--function onSay(cid, words, param)local player = getPlayerByName(param)if not isInArray({"list", "exit", "off", "on"}, param) and not param or param == "" thendoSendMagicEffect(getThingPos(cid), 2)doPlayerSendTextMessage(cid, 20, "Enter the name of the player, which you want to cast in parameters.")return trueendif param == "on" thenif getPlayerStorageValue(cid, 10359) >= 1 thendoSendMagicEffect(getThingPos(cid), 2)doPlayerSendTextMessage(cid, 20, "Your Cast System is already running ONLINE!")return trueendcastOn(cid)doSendMagicEffect(getThingPos(cid), 39)doPlayerSendTextMessage(cid, 20, "You have activated your Cast System, now others can cast you, to disable this feature, use the parameter '!cast off'.")return trueendif param == "off" thenif getPlayerStorageValue(cid, 10359) < 1 thendoSendMagicEffect(getThingPos(cid), 2)doPlayerSendTextMessage(cid, 20, "Your Cast System is already OFFLINE!")return trueendcastOff(cid)doSendMagicEffect(getThingPos(cid), 39)doPlayerSendTextMessage(cid, 20, "You have disabled your Cast System, from now on no one can watch you, unless you turn on the Cast, using the parameter '!cast on'.")return trueendif param == "exit" thenif getPlayerStorageValue(cid, 12269) < 1 thendoSendMagicEffect(getThingPos(cid), 2)doPlayerSendTextMessage(cid, 20, "You no are casting players.")return trueendcancelCast(cid)doSendMagicEffect(getThingPos(cid), 39)doPlayerSendTextMessage(cid, 20, "You stopped casting, use the parameter '!cast list' to see who can be casted.")return trueendif param == "list" thenif #whoCasted() < 1 thendoSendMagicEffect(getThingPos(cid), 2)doPlayerSendTextMessage(cid, 20, "At this time, no player can be casted, try again later.")return trueenddoPlayerSendTextMessage(cid, 20, "Players can be casteds:\n\n")for k, v in ipairs(whoCasted()) dodoPlayerSendTextMessage(cid, 20, " - "..getCreatureName(v).."")end return trueendif not isPlayer(player) thendoSendMagicEffect(getThingPos(cid), 2)doPlayerSendTextMessage(cid, 20, "This player is offline or does not exist. Use the parameter '!cast list' to see who can be casted.")return trueendif getPlayerStorageValue(player, 10359) < 1 thendoSendMagicEffect(getThingPos(cid), 2)doPlayerSendTextMessage(cid, 20, "You can only cast one person with the Cast System is activated, use the parameter '!cast list' to see who can be assisted.")return trueendif getPlayerStorageValue(cid, 10359) >= 1 thendoSendMagicEffect(getThingPos(cid), 2)doPlayerSendTextMessage(cid, 20, "To cast a player, you must first disable your Cast System using the parameter '!cast off'.")return trueendif not getTileInfo(getThingPos(cid)).protection thenreturn doPlayerSendTextMessage(cid, 20, "You need enter in Protection Zone to use the Cast System.") and trueendsetPlayerStorageValue(cid, 12269, 1)castPlayer(cid, player)doSendMagicEffect(getThingPos(cid), 39)doPlayerSendTextMessage(cid, 20, "You are casting the player "..getCreatureName(player)..", to exit just use the command '!cast exit'.")doPlayerSendTextMessage(player, 20, "You are casted by "..getCreatureName(cid).." player to disable your Cast, simply use the parameter '!cast off'.")return trueendfunction cancelCast(uid)mayNotMove(uid, false)doCreatureSetHideHealth(uid, false)setPlayerStorageValue(uid, 12269, -1)doRemoveCondition(uid, CONDITION_OUTFIT) return doTeleportThing(uid, getTownTemplePosition(getPlayerTown(uid))) or doTeleportThing(uid, getPlayerMasterPos(uid)) and trueendfunction castOn(uid)return setPlayerStorageValue(uid, 10359, 1) and trueendfunction castOff(uid)return setPlayerStorageValue(uid, 10359, -1) and trueendfunction castPlayer(uid, player)if not isPlayer(player) thencancelCast(uid)return trueendif getPlayerStorageValue(player, 10359) < 1 thencancelCast(uid)return trueendif getPlayerStorageValue(uid, 12269) < 1 thencancelCast(uid)return trueendmayNotMove(uid, true)doSetItemOutfit(uid, 1934, -1)doCreatureSetHideHealth(uid, true)doTeleportThing(uid, getThingPos(player))return addEvent(castPlayer, 1 * 1000, uid, player) and trueendfunction whoCasted()local casteds = {}for _, pid in ipairs(getPlayersOnline()) doif getPlayerStorageValue(pid, 10359) >= 1 thentable.insert(casteds, pid)endendreturn #casteds > 0 and casteds or {}end Volte uma pasta (data/talkaction) abra com algum editor de texto o arquivo talkactions.xml e adicione essa tag em qualquer lugar: <talkaction words="!cast;/cast" event="script" value="castSys.lua"/> Muito bem, após isso siga para a pasta data/creaturescripts/scripts, faça o mesmo, crie um arquivo chamado castSys.lua e adicione isso function onLogout(cid)if getPlayerStorageValue(cid, 12269) > 0 thendoPlayerSendCancel(cid, "To logout, you need to exit the Cast System first. Use the parameter '!cast exit'.")return falseendsetPlayerStorageValue(cid, 10359, -1)return trueendfunction onStatsChange(cid, attacker, type, combat, value)if not isCreature(cid) thenreturn trueendif getPlayerStorageValue(cid, 12269) >= 1 and isMonster(attacker) or isPlayer(attacker) thenreturn falseendreturn trueendfunction onAttack(cid, target)if not isPlayer(cid) or not isPlayer(target) thenreturn trueendif getPlayerStorageValue(cid, 12269) > 0 thendoRemoveCondition(cid, CONDITION_INFIGHT)return falseendreturn trueend Já no arquivo creaturescripts.xml, você vai adicionar essa tag: <event type="attack" name="castAttack" event="script" value="castSys.lua"/><event type="statschange" name="castHits" event="script" value="castSys.lua"/><event type="logout" name="castLogout" event="script" value="castSys.lua"/> E no arquivo login.lua você vai adicionar essas 3 linhas: registerCreatureEvent(cid, "castAttack")registerCreatureEvent(cid, "castHits")registerCreatureEvent(cid, "castLogout") Para que o player que está assitindo ao outro não use magias enquanto está assistindo, coloque essas linhas abaixo dentro de cada script das magias, debaixo da linha: function onCastSpell(cid, var) Coloque: if getPlayerStorageValue(cid, 12269) >= 1 thenreturn falseend Prontinho galera, basta reiniciar o servidor e usar, é isto por hoje, espero que tenham gostado, ideias/sugestões para futuras versões, bugs ou críticas sobre o sistema, basta deixar um simples comentário aí no tópico, estarei aqui para atendê-los. Créditos: Roksas kekezitolhp Link para o comentário Compartilhar em outros sites More sharing options...
Luga03 331 Postado Janeiro 21, 2016 Share Postado Janeiro 21, 2016 Não vejo necessidade deste tópico! Já existe o mesmo sistema no XTibia! http://www.xtibia.com/forum/topic/216738-cast-tv-system-10/ Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados