
Tudo que Frenesy postou
-
(Resolvido)[duvida]BordCast message com o nome do player
function onSay(cid, words, param) if(getPlayerItemCount(cid, 9971) > 0) then doPlayerRemoveItem(cid, 9971, 1) doPlayerSetVocation(cid, getPlayerVocation(cid)+4) doCreatureSay(cid, "Parabens "..getCreatureName(cid).." voce ganhou a "..getPlayerVocationName(cid).." vocation", TALKTYPE_ORANGE_1) end end #EDIT Faz um favor: Nessa parte do Script: doPlayerSetVocation(cid, getPlayerVocation(cid)+4) Assim que você receber essa Vocation, deslogue ou feche o servidor e logue ou abra novamente o servidor pra vê se continua com a Vocation que recebeu. Já vi algumas pessoas reclamando que sempre que usa a função assim, ele costuma dar erro.
-
bau que da ml no item help
É preciso entender que a função: doItemSetAttribute Embora aparenta ter muitos atributos, não funciona todas. Estava trabalhando em um script de SLOT que envolvia essa função, mas ao testar em meu servidor, poucos funcionaram. Acho que varia de servidor pra servidor. No meu caso funcionou o "extraattack", por exemplo: doItemSetAttribute(itemEx.uid,'extraattack',10) Faça um teste adicionado a função de extraattack que eu citei acima em seu script. Se der certo, perceberá que nem todas as funções funciona em seu servidor.
-
Poison STAR -
Se o monstro for imune a Poison, sua vip star vai te deixar na mão
-
Poison STAR -
Seria mais ou menos isso: Weapons/vip_star.lua: local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_GREENSTAR) setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 0, 1.0, 0) local xCombat = createCombatObject() setCombatParam(xCombat, COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) local condition = createConditionObject(CONDITION_POISON) setConditionParam(condition, CONDITION_PARAM_DELAYED, 1) addDamageCondition(condition, 4, 2000, -2) addDamageCondition(condition, 6, 2000, -1) setCombatCondition(xCombat, condition) function onUseWeapon(cid, var) local ret = doCombat(cid, combat, var) if(ret == false) then return false end local target = variantToNumber(var) if(target ~= 0) then -- chance to poison the enemy local chance = math.random(0, 100) if(chance > 90) then ret = doCombat(cid, xCombat, var) end end return ret end Vá em Weapons.xml e adicione essa tag: <distance id="XXXX" event="script" value="vip_star.lua"/>
-
Maquina de Summon APRIMORADA
No Tile ou Teleporte de saída da sala, você pode colocar para Scannear toda a área. Se tiver monstro lá dentro, o script remove. function onStepIn(cid, item, position, fromPosition) for posx = 367,480 do -- checar posição X, começo e final da sala for posy = 378,478 do -- checar posicao Y, começo e final da sala local pos = {x=posx, y=posy, z=14, stackpos=253} -- nao mexer aqui local creature = getThingfromPos(pos) -- pega informações da creature da posição (nao mexer aqui) if isMonster(creature.uid) then -- verifica se é um monster doRemoveCreature(creature.uid) -- se for monster deleta ele end end end return TRUE end
-
(Resolvido)[URGENTE] Wrath emperor script please
-- < Script by Frenesy > -- 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 onThink() npcHandler:onThink() end function doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) 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 if(msgcontains(msg, 'Quest') or msgcontains(msg, 'Mission')) then selfSay('Quer fazer a mission?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerStorageValue(cid, 2050) == 1 and getPlayerStorageValue(cid, 2051) == 1 and getPlayerStorageValue(cid, 2052) == 1 and getPlayerStorageValue(cid, 2053) == 1 then selfSay('Ok, voce pode fazer a quest agora.', cid) doSendMagicEffect(getPlayerPosition(cid), 10) doTeleportThing(cid, {x= 99, y= 189, z= 7}) setPlayerStorageValue(cid, 2050, -1) -- Remover Missão setPlayerStorageValue(cid, 2051, -1) -- Remover Missão setPlayerStorageValue(cid, 2052, -1) -- Remover Missão setPlayerStorageValue(cid, 2053, -1) -- Remover Missão talkState[talkUser] = 0 else selfSay('Voce nao tem o que e necessario para essa mission.', cid) end elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then selfSay('Volte quando estiver pronto.', cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
rep++ yalahar quest
Repasse para nós o Script que esta dando erro.
-
(Resolvido)[URGENTE] Wrath emperor script please
Não deveria ter fechado o Tópico sem antes ter testado o Script. -- < Script by Frenesy > -- 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 onThink() npcHandler:onThink() end function doCreatureSayWithDelay(cid,text,type,delay,e) if delay<=0 then doCreatureSay(cid,text,type) else local func=function(pars) doCreatureSay(pars.cid,pars.text,pars.type) pars.e.done=TRUE end e.done=FALSE e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e}) end end function cancelNPCTalk(events) local ret=1 for aux=1,table.getn(events) do if events[aux].done==FALSE then stopEvent(events[aux].event) else ret=ret+1 end end events=nil return(ret) end function doNPCTalkALot(msgs,interval) local e={} local ret={} if interval==nil then interval=3000 end --3 seconds is default time between messages for aux=1,table.getn(msgs) do e[aux]={} doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux]) table.insert(ret,e[aux]) end return(ret) 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 if(msgcontains(msg, 'Quest') or msgcontains(msg, 'Mission')) then selfSay('Quer fazer a mission?', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) and if getPlayerStorageValue(cid, 2050) == 1 and getPlayerStorageValue(cid, 2051) == 1 and getPlayerStorageValue(cid, 2052) == 1 and getPlayerStorageValue(cid, 2053) == 1 then selfSay('Ok, voce pode fazer a quest agora.', cid) doSendMagicEffect(getPlayerPosition(cid), 10) doTeleportThing(cid, {x= 99, y= 189, z= 7}) setPlayerStorageValue(cid, 2050, -1) -- Remover Missão setPlayerStorageValue(cid, 2051, -1) -- Remover Missão setPlayerStorageValue(cid, 2052, -1) -- Remover Missão setPlayerStorageValue(cid, 2053, -1) -- Remover Missão talkState[talkUser] = 0 else selfSay('Voce nao tem o que e necessario para essa mission.', cid) end elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) and selfSay('Volte quando estiver pronto.', cid) talkState[talkUser] = 0 end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
Um Ideia que precisa de Ajuste!
Estou no serviço agora, mas assim que chegar em casa eu testo. Obrigado pela dica. #Suicide Infelizmente, o seu Script não funcionou. Independente de quem mate - seja Time 1, seja Time 2 O Time 2 sempre recebe a mensagem. #EDIT² Fiz uma pequena modificação aqui pra mim testar assim que chegar em casa. local stor = {8888, 9999} -- storage ~ {team1, team2} local gstor = {5000, 5001} -- global storage ~ {team1, team2} function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) then if getPlayerStorageValue(attacker, stor[1]) == 1 then if getGlobalStorageValue(gstor[1]) < 0 then setGlobalStorageValue(gstor[1], 0) end setGlobalStorageValue(gstor[1], getGlobalStorageValue(gstor[1])+1) elseif getPlayerStorageValue(attacker, stor[2]) == 1 then if getGlobalStorageValue(gstor[2]) < 0 then setGlobalStorageValue(gstor[2], 0) end setGlobalStorageValue(gstor[2], getGlobalStorageValue(gstor[2])+1) end end return true end function onDeath(cid) if getGlobalStorageValue(gstor[1]) > getGlobalStorageValue(gstor[2]) then doCreatureSay(cid, 'O Time 1 me matou.', TALKTYPE_ORANGE_1) else doCreatureSay(cid, 'O Time 2 me matou.', TALKTYPE_ORANGE_1) elseif getGlobalStorageValue(gstor[1]) == getGlobalStorageValue(gstor[2]) then doCreatureSay(cid, 'Empate Tecnico.', TALKTYPE_ORANGE_1) end return true end
-
OTClient Não salva configurações
Uso a versão 0.6.5. do OTClient. Utilizo ele para abrir meu OTServ 9.83.
-
(Resolvido)Bug Bows n ataca de Longe !
Já verificou a ranger no Items.xml?
-
(Resolvido)[Dúvida] Função onKill
Já tentou algo assim? function onDeath(cid, corpse, killer) --==============================================================================-- local monstName = "Dragon" -- Nome do monstro --==============================================================================-- if isMonster(cid) then if string.lower(getCreatureName(cid)) == string.lower(monstName) then doCreatureSay(killer[1], "Voce me matou!", TALKTYPE_ORANGE_1) end end return TRUE end
-
Um Ideia que precisa de Ajuste!
Deixa eu ver se entendi: Está supondo que eu adicione +1 value em uma GlobalStorage cada vez que algum membro do time atacar o monstro - usando attacker - e que no final faça uma verificação de qual GlobalStorage está maior? OBS: Aqui esta o Script rascunho que fiz apenas pra testar. function onDeath(cid, corpse, killer) --==============================================================================-- local monstName = "Dragon" -- Nome do monstro --==============================================================================-- if isMonster(cid) then if string.lower(getCreatureName(cid)) == string.lower(monstName) then if getPlayerStorageValue(killer[1], 5000) == 1 then doCreatureSay(cid, "O Time 1 me matou.", TALKTYPE_ORANGE_1) end if getPlayerStorageValue(killer[1], 5001) == 1 then doCreatureSay(cid, "O Time 2 me matou.", TALKTYPE_ORANGE_1) end end end return TRUE end
-
Um Ideia que precisa de Ajuste!
onDeath
-
Perde a vocação quando desloga
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 onThink() npcHandler:onThink() 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 if (msgcontains(msg, 'promotion')) then selfSay('Eu posso lhe ensinar uma nova promotion, voce aceita?', cid) talkState[talkUser] = 1 elseif (msgcontains(msg, 'yes') and talkState[talkUser] == 1) then if getPlayerPremiumDays(cid) > 0 then selfSay('Parabens, voce evoluiu sua promotion!', cid) doPlayerSetPromotionLevel(cid, 2) doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS) talkState[talkUser] = 0 else selfSay('Voce precisa ser premium para ter essa promotion.', cid) talkState[talkUser] = 0 end elseif (msgcontains(msg, 'no') and talkState[talkUser] == 1) then selfSay('Entao adeus, jovem gafanhoto.', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Estou no serviço, não tenho como testar. Meio que fiz no improviso.
-
(Resolvido)[URGENTE] Wrath emperor script please
Esqueci desse detalhe 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 onThink() npcHandler:onThink() 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 msg = string.lower(msg) if (msgcontains(msg, 'quest) or msgcontains(msg, 'mission)) then selfSay("Voce tem as storages da mission?.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 2050) == 1 and getPlayerStorageValue(cid, 2051) == 1 and getPlayerStorageValue(cid, 2052) == 1 and getPlayerStorageValue(cid, 2053) == 1 then selfSay("Legal, vc pode fazer a Quest.", cid) setPlayerStorageValue(cid, 2050, -1) setPlayerStorageValue(cid, 2051, -1) setPlayerStorageValue(cid, 2052, -1) setPlayerStorageValue(cid, 2053, -1) doTeleportThing(cid, {x= 99, y= 189, z= 7}) talkState[talkUser] = 0 else selfSay("Voce nao tem todas as storages", cid) talkState[talkUser] = 0 return true end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)[URGENTE] Wrath emperor script please
Meio que improvisei aqui. Estou no serviço, não tem como testar. 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 onThink() npcHandler:onThink() 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 msg = string.lower(msg) if (msgcontains(msg, 'quest) or msgcontains(msg, 'mission)) then selfSay("Voce tem as storages da mission?.", cid) talkState[talkUser] = 1 elseif msgcontains(msg, 'yes') and talkState[talkUser] == 1 then if getPlayerStorageValue(cid, 2050) == 1 and getPlayerStorageValue(cid, 2051) == 1 and getPlayerStorageValue(cid, 2052) == 1 and getPlayerStorageValue(cid, 2053) == 1 then selfSay("Legal, vc pode fazer a Quest.", cid) setPlayerStorageValue(cid, 2050, -1) setPlayerStorageValue(cid, 2051, -1) setPlayerStorageValue(cid, 2052, -1) setPlayerStorageValue(cid, 2053, -1) talkState[talkUser] = 0 else selfSay("Voce nao tem todas as storages", cid) talkState[talkUser] = 0 return true end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)[Actions] Bau que da mana e hp
function onUse(cid, item, frompos, item2, topos) queststatus = getPlayerStorageValue(cid,50100) if item.uid == 50020 then if queststatus == -1 then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid)+1000000) setCreatureMaxMana(cid, getCreatureMaxMana(cid)+1000000) doPlayerSendTextMessage(cid,22,"Você ganhou 1kk de mana/hp.") setPlayerStorageValue(cid,50100,1) else doPlayerSendTextMessage(cid,22,"It is empty.") end else return 0 end return 1 end
-
(Resolvido)Script de Use Teleport
function onUse(cid, item, position, fromPosition, itemEx, toPosition) local PlayPosUm = {x=496, y=501, z=5} -- Posição 1 do Jogar local PlayPosDois = {x=501, y=501, z=5} -- Posição 2 do Jogar local PlayUm = getTopCreature(PlayPosUm).uid local PlayDois = getTopCreature(PlayPosDois).uid if isPlayer(PlayUm) then doTeleportThing(cid, PlayPosDois) doSendMagicEffect(getPlayerPosition(cid), 10) elseif isPlayer(PlayDois) then doTeleportThing(cid, PlayPosUm) doSendMagicEffect(getPlayerPosition(cid), 10) else doPlayerSendCancel(cid,"Voce precisa estar em determinada lugar.") doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end function onUse(cid, item, position, fromPosition, itemEx, toPosition) local Pos = {x=496, y=501, z=5} -- Posição para onde o jogador vai if getPlayerLevel(cid) >= 500 then doTeleportThing(cid, Pos) doSendMagicEffect(getPlayerPosition(cid), 10) else doPlayerSendCancel(cid,"Voce precisa de Nv. 500 para usar este Item.") doSendMagicEffect(getPlayerPosition(cid), 2) end return TRUE end
-
Um Ideia que precisa de Ajuste!
Pessoal, estou com um problema. Minha ideia é bem simples: Time 1 = Storage Z Time 2 = Storage Y Time 1 e Time 2 matam um mesmo Monstro. Se o Player do Time 1 mata o monstro, o monstro ao morrer deixa a mensagem: doCreatureSay(cid, "Time 1 me matou.", TALKTYPE_ORANGE_1) Se o Player do Time 2 mata o monstro, o monstro ao morrer deixa a mensagem: doCreatureSay(cid, "Time 2 me matou.", TALKTYPE_ORANGE_1) Até aqui, está tudo muito simples. O meu problema é que: O Time 1 é formado por alguns Players - digamos, 5. O Time 1, com todos os seus integrantes atacam o monstro. Quando o monstro está com o Life em vermelho, basta um único membro do Time 2 dar o ultimo HIT para o Time 2 ganhar o evento. Sendo que o Time 1 teve todo o trabalho. Eu queria uma forma que o monstro identifica-se, ao morrer, qual time lhe atingiu mais vezes. Bem, espero que eu tenho sido claro. Ficarei no Aguardo. Abraços!
-
(Resolvido)math.random
Por favor, me ajuda a usar essa função corretamente. Aqui está parte de meu Script: if getPlayerStorageValue(cid, 3509) > 0 then local rand = math.random(1,45) if rand == 1 then doPlayerAddItem(cid, 2488, 1) -- Crown Legs doSendMagicEffect(getPlayerPosition(cid), 12) end Como eu usaria sua função aqui?
-
(Resolvido)math.random
Pessoal, eu não entendo essa função. Pensei que ela joga-se de forma aleatória um conjunto de números. Por exemplo: math.random(1,45) Nisso, ao acionar essa função, números de 1 á 45 seriam gerados de forma aleatória. No entanto, sempre que eu clico no Baú - que é onde ativa essa função - ele da sempre a mesma sequência. Por Exemplo: Clico com Player 1 - Gera a Sequência 1, 3, 5. Clico com Player 2 - Gera a Sequência 2, 4, 6. No entanto, sempre que fecho o OT e abro novamente, ao clicar novamente no baú, dá a mesma sequência citados acima. Não ta sendo realmente de forma aleatória. Alguém poderia me explicar do por que ser assim?
-
OTClient Não salva configurações
Ainda não tentei. Irei verificar. #Edit Pois é, não deu certo.
-
OTClient Não salva configurações
Não sei se é aqui mesmo que devo postar isso, mas... Meu OTClient não salva configurações no meu PC. Toda vez que entro nele tenho que configurar tudo outra vez, como se fosse a primeira vez que o abro. Alguem tem alguma sugestão? Uso Windows 7 64x
-
Uma pequena modificação nessa Action
#Comedinha, não deu certo. Alguem tem outra sugestão?