
Vinicioss
Membro
-
Registro em
-
Última visita
Histórico de Curtidas
-
Vinicioss deu reputação a luanluciano93 em [TFS 1.x] Gaz'Haragoth (Heal + Magia + Teleport)Eai pessoal, criei esse tópico para postar o script do heal e do teleport do Gaz, em breve complemento com a magia (avisa e depois solta uma magia que da hs em qualquer um).
HEAL - Se o life dele chega a 50k, ele solta um aviso, e depois de 5 segundos heala 300k.
Crie um arquivo em creaturescripts/scripts/ com o nome heal_gaz.lua e coloque esse código:
-- <event type="healthchange" name="HealGaz" script="heal_gaz.lua"/> local config = { life_ative = 50000, life_add = 300000, seconds_ative = 5, gStorage = 90702, } local function Uheal(cid) local gaz = Monster(cid) gaz:addHealth(config.life_add) gaz:say("Gaz'haragoth HEALS himself!", TALKTYPE_MONSTER_SAY) gaz:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED) Game.setStorageValue(config.gStorage, 0) end function onHealthChange(creature, attacker, primaryDamage, primaryType, secondaryDamage, secondaryType, origin) if attacker then if creature:getHealth() < config.life_ative and Game.getStorageValue(config.gStorage) < 1 then creature:say("Gaz'haragoth beginns to draw on the nightmares to HEAL himself!", TALKTYPE_MONSTER_SAY) addEvent(Uheal, 1000 * config.seconds_ative, creature.uid) Game.setStorageValue(config.gStorage, 1) end end return primaryDamage, primaryType, secondaryDamage, secondaryType end A tag que deve add ao creaturescript.xml esta como comentário no script, é só add.
Depois para funcionar no Gaz, vá até o xml dele em monster e coloque em seu código:
<script> <event name="HealGaz" /> </script> TELEPORT - Quem passa em cima do corpo dos summons do boss é teleportado para perto dele.
Crie um arquivo em movements/scripts/ com o nome tp_gaz.lua e coloque esse código:
-- <movevent event="StepIn" itemid="22455" script="teleport_gaz.lua"/> function onStepIn(creature, item, position, fromPosition) local player = creature:getPlayer() if player == nil then return false end local monster = Creature("Gaz'Haragoth") if monster then player:teleportTo(monster:getPosition()) else player:teleportTo(fromPosition) end return true end A tag que deve add ao movements.xml esta como comentário no script, é só add.
Em breve a ultima atualização.
-
Vinicioss deu reputação a Povildo em NPC Mount! - Atualizado para 9.44Olá gente eu vim trazer aqui para você o NPC Mount 9.44!
Apoio: OTWorks
Atualização: 26/02/2012
Vai em "Data/NPC" Cria um documento XML e bota o nome "Mount" e colla isso aqui em baixo dentro.
<npc name="Mount" script="mounts.lua" walkinterval="2000" floorchange="0"> <health now="100" max="100"/> <look type="146" head="24" body="59" legs="135" feet="0" addons="3" mount="426"/> <parameters> <parameter key="message_greet" value="Hi |PLAYERNAME|, I sell these mounts: {Widow Queen}, {Rapid Bird}, {War Bear}, {Black Sheep}, {Midnight Panther}, {Draptor}, {Titanica}, {Tin Lizzard}, {Blazebringer}, {Rapid Boar}, {Stampor}, {Undead Cavebear}, {Donkey}, {Tiger Slug}, {Uniwheel}, {Crystal Wolf}, {War Horse}, {Kingly Deer}, {Tamed Panda}, {Saddled Dromedary}, {Scorpion King}, {Rented Horse Brown Dark}, {Fire War Horse}, {Shadow Draptor}, {Rented Horse Gray} or {Rented Horse Brown}! - Speak the name of Mounts {nomemdamontaria}Ex: Draptor."/> </parameters> </npc> Agora você vai em "Data/NPC/Scripts" E crie um arquivo .LUA de renomeia para "mounts" e cola isso aqui em baixo dentro. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) 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 onThink() npcHandler:onThink() end function AddMount(cid, message, keywords, parameters, node) --by vodka if(not npcHandler:isFocused(cid)) then return false end if parameters.premium == true and not isPremium(cid) then return true,npcHandler:say('Sorry,Only premium members buy this mount!', cid) elseif not doPlayerRemoveMoney(cid, parameters.price) then return true,npcHandler:say('Sorry You need '..parameters.price..' gps to buy this mount!', cid) end doPlayerAddMount(cid, parameters.mount) npcHandler:say('Here is your mount!', cid) npcHandler:resetNpc() return true end keywordHandler:addKeyword({'mounts'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell these mounts: {Widow Queen}, {Rapid Bird}, {War Bear}, {Black Sheep}, {Midnight Panther}, {Draptor}, {Titanica}, {Tin Lizzard}, {Blazebringer}, {Rapid Boar}, {Stampor}, {Undead Cavebear}, {Donkey}, {Tiger Slug}, {Uniwheel}, {Crystal Wolf}, {War Horse}, {Kingly Deer}, {Tamed Panda}, {Saddled Dromedary}, {Scorpion King}, {Rented Horse Brown Dark}, {Fire War Horse}, {Shadow Draptor}, {Rented Horse Gray} or {Rented Horse Brown}!'}) local node1 = keywordHandler:addKeyword({'widow queen'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount widow queen?'}) node1:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 1,premium = false}) node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node2 = keywordHandler:addKeyword({'rapid bird'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount racing bird'}) node2:addChildKeyword({'yes'}, AddMount, {price = 20000,mount = 2,premium = false}) node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node3 = keywordHandler:addKeyword({'war bear'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount war Bear'}) node3:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 3,premium = false}) node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node4 = keywordHandler:addKeyword({'black sheep'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount black sheep?'}) node4:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 4,premium = false}) node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node5 = keywordHandler:addKeyword({'midnight panther'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount midnight panther?'}) node5:addChildKeyword({'yes'}, AddMount, {price = 20000,mount = 5,premium = false}) node5:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node6 = keywordHandler:addKeyword({'draptor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount draptor?'}) node6:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 6,premium = false}) node6:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node7 = keywordHandler:addKeyword({'titanica'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount titanica?'}) node7:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 7,premium = false}) node7:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node8 = keywordHandler:addKeyword({'tin lizzard'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount tin lizzard?'}) node8:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 8,premium = false}) node8:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node9 = keywordHandler:addKeyword({'blazebringer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount blazebringer?'}) node9:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 9,premium = false}) node9:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node10 = keywordHandler:addKeyword({'rapid boar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount rapid boar?'}) node10:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 10,premium = false}) node10:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node11 = keywordHandler:addKeyword({'stampor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount stampor?'}) node11:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 11,premium = false}) node11:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node12 = keywordHandler:addKeyword({'undead cavebear'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the mount undead cavebear?'}) node12:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 12,premium = false}) node12:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node13 = keywordHandler:addKeyword({'donkey'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the Donkey?'}) node13:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 13,premium = false}) node13:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node14 = keywordHandler:addKeyword({'tiger slug'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the tiger slug?'}) node14:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 14,premium = false}) node14:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node15 = keywordHandler:addKeyword({'uniwheel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the uniwheel?'}) node15:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 15,premium = false}) node15:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node16 = keywordHandler:addKeyword({'crystal wolf'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the crystal wolf?'}) node16:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 16,premium = false}) node16:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node17 = keywordHandler:addKeyword({'brown war horse'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the brown war horse?'}) node17:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 17,premium = false}) node17:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node18 = keywordHandler:addKeyword({'kingly deer'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the Kingly Deer?'}) node18:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 18,premium = false}) node18:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node19 = keywordHandler:addKeyword({'tamed panda'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the Tamed Panda?'}) node19:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 19,premium = false}) node19:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node20 = keywordHandler:addKeyword({'saddled dromedary'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the Saddled Dromedary?'}) node20:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 20,premium = false}) node20:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node21 = keywordHandler:addKeyword({'scorpion king'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the Scorpion King?'}) node21:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 21,premium = false}) node21:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node22 = keywordHandler:addKeyword({'rented horse brown dark'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy the Rented Horse Brown Dark?'}) node22:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 22,premium = false}) node22:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node23 = keywordHandler:addKeyword({'fire war horse'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy fire War Horse?'}) node23:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 23,premium = false}) node23:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node24 = keywordHandler:addKeyword({'shadow draptor'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy Shadow Draptor?'}) node24:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 24,premium = false}) node24:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node25 = keywordHandler:addKeyword({'rented horse gray'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy Rented Horse Gray?'}) node25:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 25,premium = false}) node25:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) local node26 = keywordHandler:addKeyword({'rented horse brown'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'You want to buy Rented Horse Brown?'}) node26:addChildKeyword({'yes'}, AddMount, {price = 10000,mount = 26,premium = false}) node26:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Ok, then.', reset = true}) npcHandler:addModule(FocusModule:new())
-
Vinicioss deu reputação a KekezitoLHP em [Sistema] Cast System para 8.6Bom 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 == "" then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Enter the name of the player, which you want to cast in parameters.") return true end if param == "on" then if getPlayerStorageValue(cid, 10359) >= 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Your Cast System is already running ONLINE!") return true end castOn(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 true end if param == "off" then if getPlayerStorageValue(cid, 10359) < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "Your Cast System is already OFFLINE!") return true end castOff(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 true end if param == "exit" then if getPlayerStorageValue(cid, 12269) < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "You no are casting players.") return true end cancelCast(cid) doSendMagicEffect(getThingPos(cid), 39) doPlayerSendTextMessage(cid, 20, "You stopped casting, use the parameter '!cast list' to see who can be casted.") return true end if param == "list" then if #whoCasted() < 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "At this time, no player can be casted, try again later.") return true end doPlayerSendTextMessage(cid, 20, "Players can be casteds:\n\n") for k, v in ipairs(whoCasted()) do doPlayerSendTextMessage(cid, 20, " - "..getCreatureName(v).."") end return true end if not isPlayer(player) then doSendMagicEffect(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 true end if getPlayerStorageValue(player, 10359) < 1 then doSendMagicEffect(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 true end if getPlayerStorageValue(cid, 10359) >= 1 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendTextMessage(cid, 20, "To cast a player, you must first disable your Cast System using the parameter '!cast off'.") return true end if not getTileInfo(getThingPos(cid)).protection then return doPlayerSendTextMessage(cid, 20, "You need enter in Protection Zone to use the Cast System.") and true end setPlayerStorageValue(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 true end function 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 true end function castOn(uid) return setPlayerStorageValue(uid, 10359, 1) and true end function castOff(uid) return setPlayerStorageValue(uid, 10359, -1) and true end function castPlayer(uid, player) if not isPlayer(player) then cancelCast(uid) return true end if getPlayerStorageValue(player, 10359) < 1 then cancelCast(uid) return true end if getPlayerStorageValue(uid, 12269) < 1 then cancelCast(uid) return true end mayNotMove(uid, true) doSetItemOutfit(uid, 1934, -1) doCreatureSetHideHealth(uid, true) doTeleportThing(uid, getThingPos(player)) return addEvent(castPlayer, 1 * 1000, uid, player) and true end function whoCasted() local casteds = {} for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, 10359) >= 1 then table.insert(casteds, pid) end end return #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 then doPlayerSendCancel(cid, "To logout, you need to exit the Cast System first. Use the parameter '!cast exit'.") return false end setPlayerStorageValue(cid, 10359, -1) return true end function onStatsChange(cid, attacker, type, combat, value) if not isCreature(cid) then return true end if getPlayerStorageValue(cid, 12269) >= 1 and isMonster(attacker) or isPlayer(attacker) then return false end return true end function onAttack(cid, target) if not isPlayer(cid) or not isPlayer(target) then return true end if getPlayerStorageValue(cid, 12269) > 0 then doRemoveCondition(cid, CONDITION_INFIGHT) return false end return true end 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 then return false end 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.