-
Total de itens
1917 -
Registro em
-
Última visita
-
Dias Ganhos
7
Posts postados por BrunooMaciell
-
-
47 minutos atrás, Taiger disse:
ta dando erro aqui
if #getCreatureSummfighting = falseons(_target) > 0 then
Estou mandando o script do npc sabrina. tem como vc fazer a edicao para nos?
local focus = 0
local max_distance = 8
local talk_start = 0
local conv = 0
local fighting = false
local challenger = 0
local afk_limit_time = 300 -- seconds
local afk_time = 0 -- don't change
local battle_turn = 1 -- don't change
local challenger_turn = 0 -- don't change
local pokemons = {
{name = "Shiny Alakazam", optionalLevel = 300, sex = SEX_MALE, nick = "", ball = "normal"},
{name = "Shiny Hypno", optionalLevel = 300, sex = SEX_MALE, nick = "", ball = "normal"},
{name = "Shiny Mr. Mime", optionalLevel = 300, sex = SEX_FEMALE, nick = "", ball = "normal"},
{name = "Porygon", optionalLevel = 400, sex = SEX_FEMALE, nick = "", ball = "normal"},
{name = "Shiny Espeon", optionalLevel = 300, sex = SEX_FEMALE, nick = "", ball = "normal"},
}
local function doSummonGymPokemon(npc)
local this = npc
if #getCreatureSummons(this) >= 1 or focus == 0 then return true end
local it = pokemons[battle_turn]
doSummonMonster(this, it.name)
local summon = getCreatureSummons(this)[1]
local balleffect = pokeballs["normal"].effect
if it.ball and pokeballs[it.ball] then
balleffect = pokeballs[it.ball].effect
end
doSendMagicEffect(getThingPos(summon), balleffect)
setPlayerStorageValue(summon, 10000, balleffect)
setPlayerStorageValue(summon, 10001, gobackmsgs[math.random(#gobackmsgs)].back:gsub("doka", it.nick ~= "" and it.nick or it.name))
setPlayerStorageValue(summon, 1007, it.nick ~= "" and it.nick or it.name)
doSetMonsterGym(summon, focus) setPlayerStorageValue(summon, 10002, 1)
addEvent(adjustWildPoke, 15, summon, it.optionalLevel)
local name = it.nick ~= "" and it.nick or getCreatureNameWithProtect(this).."s "..it.name
doCreatureSay(this, gobackmsgs[math.random(#gobackmsgs)].go:gsub("doka", getPlayerStorageValue(summon, 1007)), 1)
fighting = true
battle_turn = battle_turn + 1
end
local function doWinDuel(cid, npc)
if not isCreature(cid) then return true end
if getPlayerStorageValue(cid, 46677) ~= 1 then return true end
setPlayerStorageValue(cid, 46677, -1)
setPlayerStorageValue(cid, SABRINA_BADGE, 1)
local this = npc
doCreatureSay(npc, "You won the duel! Congratulations", 1)
doPlayerSendCancel(cid, "#getBadges# "..getCreatureNameWithProtect(this).." ".. 1)
end
function onCreatureSay(cid, type, msg)
if focus and (focus ~= cid and focus ~= 0) then return true end
local msg = string.lower(msg)
if getPlayerStorageValue(cid, SABRINA_BADGE) >= 0 then
setPlayerStorageValue(focus, 990, -1)
focus = 0
selfSay("Bye. You already have this badge.")
return true
end
if focus == cid then
talk_start = os.clock()
end
if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 4 then
focus = cid
talk_start = os.clock()
conv = 1
selfSay("Hello "..getCreatureNameWithProtect(cid)..", my name is Sabrina and I'm Saffron's Gym Leader. How may I help you?")
return true
end
if isDuelMsg(msg) and conv == 1 and focus == cid then
--if getPlayerItemCount(cid, gymbadges[getCreatureNameWithProtect(getThis())]) >= 1 then
-- selfSay("You have already won my Marsh Badge, maybe some other day we can fight.")
-- focus = 0
--return true
--end
if not hasPokemon(cid) then
selfSay("To battle agains't a gym leader you need pokemons.")
return true
end
selfSay("You are challenging me to a battle. It will be a "..#pokemons.." pokemon limit battle, let's start?")
conv = 2
return true
end
if isConfirmMsg(msg) and conv == 2 and focus == cid then
challenger = focus
setPlayerStorageValue(cid, 990, 1)
selfSay("Yea, let's fight!")
setPlayerStorageValue(cid, 46677, 1)
talk_start = os.clock()
addEvent(doSummonGymPokemon, 850, getThis())
conv = 3
return true
end
if isNegMsg(msg) and conv == 2 and focus == cid then
focus = 0
selfSay("It is better for you to refuse a battle against me!")
return true
end
if msgcontains(msg, 'bye') and focus == cid then
selfSay('Bye and do your best trainer!')
setPlayerStorageValue(focus, 990, -1)
focus = 0
return true
end
end
local afk_warning = false
function onThink()
--doSendAnimatedText(getThingPos(getThis()), getCreatureNameWithProtect(getThis()), 215)
if focus == 0 then
selfTurn(2)
fighting = false
challenger = 0
challenger_turn = 0
battle_turn = 1
afk_time = 0
afk_warning = false
if tonumber(#getCreatureSummons(getThis())) >= 1 then
setPlayerStorageValue(getCreatureSummons(getThis())[1], 1006, 0)
doCreatureAddHealth(getCreatureSummons(getThis())[1], -getCreatureMaxHealth(getCreatureSummons(getThis())[1]))
end
return true
else
if not isCreature(focus) then
focus = 0
return true
end
if fighting then
talk_start = os.clock()
if not isCreature(getCreatureTarget(getThis())) then
if #getCreatureSummons(challenger) >= 1 then
if getCreatureOutfit(getCreatureSummons(challenger)[1]).lookType ~= 2 then --alterado v1.6
selfAttackCreature(getCreatureSummons(challenger)[1])
challenger_turn = challenger_turn + 1
afk_time = 0
end
else
afk_time = afk_time + 0.5
end
end
if afk_time > afk_limit_time then
setPlayerStorageValue(focus, 990, -1)
focus = 0
selfSay("I have waited too long, come back when you are ready!")
return true
end
if not afk_warning and afk_time > afk_limit_time / 2 then
selfSay("Where's your pokemon? Let's fight!")
afk_warning = true
end
if #getCreatureSummons(getThis()) == 0 then
if battle_turn > #pokemons then
addEvent(doWinDuel, 1000, focus, getThis())
setPlayerStorageValue(focus, 990, -1)
focus = 0
return true
end
addEvent(doSummonGymPokemon, 1000, getThis())
end
if not hasPokemon(challenger) or challenger_turn >= 7 or challenger_turn > #pokemons then
selfSay("You lost our duel! Maybe some other time you'll defeat me.")
setPlayerStorageValue(focus, 990, -1)
focus = 0
return true
end
end
local npcpos = getThingPos(getThis())
local focpos = getThingPos(focus)
if npcpos.z ~= focpos.z then
setPlayerStorageValue(focus, 990, -1)
focus = 0
selfSay("Bye then.")
return true
end
if (os.clock() - talk_start) > 30 then
selfSay("Good bye and keep training!")
setPlayerStorageValue(focus, 990, -1)
focus = 0
end
if getDistanceToCreature(focus) > max_distance then
setPlayerStorageValue(focus, 990, -1)
focus = 0
return true
end
local dir = doRedirectDirection(getDirectionTo(npcpos, focpos))
selfTurn(dir)
end
return true
end
Ja postei a script da sabrina kkkkkkkkkkk
-
13 minutos atrás, nociam disse:
já esta ali mano em lua só observar.
Beleza mais tipo assim
Onde eu troco ou onde eu adciono ??
Tipo:
Abaixo de tal linha adciona isto
No npc do gym
local function selfAttackCreature() if #getCreatureSummons(getNpcCid()) > 0 and not isCreature(getCreatureTarget(getCreatureSummons(getNpcCid())[1])) then local list = getSpectators(getCreaturePosition(getNpcCid()), 7, 7, false) for i=0, table.getn(list) do local _target = list[i] if(_target ~= 0) then if isPlayer(_target) and not getTileInfo(getThingPos(_target)).protection then if #getCreatureSummfighting = falseons(_target) > 0 then doMonsterSetTarget(getCreatureSummons(getNpcCid())[1], getCreatureSummons(_target)[1]) setPlayerStorageValue(getCreatureSummons(getNpcCid())[1], 99856201, getNpcCid()) else fighting = false end target = _target break end end end end end
/\ em que parte eu coloco isto ??
-
33 minutos atrás, nociam disse:
Poxa pleno 2020 e ninguém ai joga a solução.
Acima do método doSummonGymPokemon coloque o método abaixo, lembrando esse método esta em lua mais todos seus métodos existem em C++ aonde pode ser escrito em C++ se desejar assim como esta feito nos sources do tfs 1.3 que tenho basta analisar o código abaixo e fazer em C++ se assim desejar.
após colocar o método local se quiser pode adaptar e tb fazer global substituir os método
selfAttackCreature(getCreatureSummons(challenger)[1]) por selfAttackCreature()
No final do método doSummonGymPokemon tb colocar o selfAttackCreature() assim o pokemon já sai atacando sem delay.
E boa sorte na jornada.
function selfAttackCreature()
local function selfAttackCreature() if #getCreatureSummons(getNpcCid()) > 0 and not isCreature(getCreatureTarget(getCreatureSummons(getNpcCid())[1])) then local list = getSpectators(getCreaturePosition(getNpcCid()), 7, 7, false) for i=0, table.getn(list) do local _target = list[i] if(_target ~= 0) then if isPlayer(_target) and not getTileInfo(getThingPos(_target)).protection then if #getCreatureSummfighting = falseons(_target) > 0 then doMonsterSetTarget(getCreatureSummons(getNpcCid())[1], getCreatureSummons(_target)[1]) setPlayerStorageValue(getCreatureSummons(getNpcCid())[1], 99856201, getNpcCid()) else fighting = false end target = _target break end end end end end
Enfim abaixo exemplo de como esta em C++ não é o completo apenas base vejam o exemplo.
tipo assim !!!
Eu queria arrumar este BUG so que em script.lua
Assim imagino eu como eu disse creio eu que todos npcs de gym aqui devem ta bugado ai queria a tag onde arrumo.
So que queria arrumar ou adptar em script.lua se tem como ??
Source nao manjo =/
-
Estou com um BUG no npc de GYM.
BUG
Spoiler[20/03/2020 17:41:54] [Error - Npc interface]
[20/03/2020 17:41:54] data/npc/scripts/gym/sabrina.lua:onThink
[20/03/2020 17:41:54] Description:
[20/03/2020 17:41:54] data/npc/scripts/gym/sabrina.lua:151: attempt to call global 'selfAttackCreature' (a nil value)
[20/03/2020 17:41:54] stack traceback:
[20/03/2020 17:41:54] data/npc/scripts/gym/sabrina.lua:151: in function <data/npc/scripts/gym/sabrina.lua:118>NPC
local focus = 0 local max_distance = 8 local talk_start = 0 local conv = 0 local fighting = false local challenger = 0 local afk_limit_time = 300 -- seconds local afk_time = 0 -- don't change local battle_turn = 1 -- don't change local challenger_turn = 0 -- don't change local pokemons = { {name = "Alakazam", optionalLevel = 400, sex = SEX_MALE, nick = "", ball = "normal"}, {name = "Shiny Hypno", optionalLevel = 400, sex = SEX_MALE, nick = "", ball = "normal"}, {name = "Mr. Mime", optionalLevel = 400, sex = SEX_FEMALE, nick = "", ball = "normal"}, {name = "Porygon", optionalLevel = 400, sex = SEX_FEMALE, nick = "", ball = "normal"}, {name = "Espeon", optionalLevel = 400, sex = SEX_FEMALE, nick = "", ball = "normal"}, } local function doSummonGymPokemon(npc) local this = npc if #getCreatureSummons(this) >= 1 or focus == 0 then return true end local it = pokemons[battle_turn] doSummonMonster(this, it.name) local summon = getCreatureSummons(this)[1] local balleffect = pokeballs["normal"].effect if it.ball and pokeballs[it.ball] then balleffect = pokeballs[it.ball].effect end doSendMagicEffect(getThingPos(summon), balleffect) setPlayerStorageValue(summon, 10000, balleffect) setPlayerStorageValue(summon, 10001, gobackmsgs[math.random(#gobackmsgs)].back:gsub("doka", it.nick ~= "" and it.nick or it.name)) setPlayerStorageValue(summon, 1007, it.nick ~= "" and it.nick or it.name) doSetMonsterGym(summon, focus) addEvent(adjustWildPoke, 15, summon, it.optionalLevel) local name = it.nick ~= "" and it.nick or getCreatureName(this).."s "..it.name doCreatureSay(this, gobackmsgs[math.random(#gobackmsgs)].go:gsub("doka", getPlayerStorageValue(summon, 1007)), 1) fighting = true battle_turn = battle_turn + 1 end local function doWinDuel(cid, npc) if not isCreature(cid) then return true end local this = npc local a = gymbadges[getCreatureName(this)] + 8 doCreatureSay(npc, "You won the duel! Congratulations, take this "..getItemNameById(a - 8).." as a prize.", 1) local b = getPlayerItemById(cid, true, a) if b.uid > 0 then doTransformItem(b.uid, b.itemid - 8) end doPlayerSendCancel(cid, "#getBadges# "..getCreatureName(this).." "..getPlayerItemCount(cid, gymbadges[getCreatureName(this)])) end function onCreatureSay(cid, type, msg) local msg = string.lower(msg) if focus == cid then talk_start = os.clock() end if msgcontains(msg, 'hi') and focus == 0 and getDistanceToCreature(cid) <= 4 then focus = cid talk_start = os.clock() conv = 1 selfSay("Hello "..getCreatureName(cid)..", my name is Sabrina and I'm Saffron's Gym Leader. How may I help you?") return true end if isDuelMsg(msg) and conv == 1 and focus == cid then --if getPlayerItemCount(cid, gymbadges[getCreatureName(getThis())]) >= 1 then -- selfSay("You have already won my Marsh Badge, maybe some other day we can fight.") -- focus = 0 --return true --end if not hasPokemon(cid) then selfSay("To battle agains't a gym leader you need pokemons.") return true end selfSay("You are challenging me to a battle. It will be a "..#pokemons.." pokemon limit battle, let's start?") conv = 2 return true end if isConfirmMsg(msg) and conv == 2 and focus == cid then challenger = focus setPlayerStorageValue(cid, 990, 1) selfSay("Yea, let's fight!") talk_start = os.clock() addEvent(doSummonGymPokemon, 850, getThis()) conv = 3 return true end if isNegMsg(msg) and conv == 2 and focus == cid then focus = 0 selfSay("It is better for you to refuse a battle against me!") return true end if msgcontains(msg, 'bye') and focus == cid then selfSay('Bye and do your best trainer!') setPlayerStorageValue(focus, 990, -1) focus = 0 return true end end local afk_warning = false function onThink() --doSendAnimatedText(getThingPos(getThis()), getCreatureName(getThis()), 215) if focus == 0 then selfTurn(2) fighting = false challenger = 0 challenger_turn = 0 battle_turn = 1 afk_time = 0 afk_warning = false if #getCreatureSummons(getThis()) >= 1 then setPlayerStorageValue(getCreatureSummons(getThis())[1], 1006, 0) doCreatureAddHealth(getCreatureSummons(getThis())[1], -getCreatureMaxHealth(getCreatureSummons(getThis())[1])) end return true else if not isCreature(focus) then focus = 0 return true end if fighting then talk_start = os.clock() if not isCreature(getCreatureTarget(getThis())) then if #getCreatureSummons(challenger) >= 1 then if getCreatureOutfit(getCreatureSummons(challenger)[1]).lookType ~= 2 then --alterado v1.6 selfAttackCreature(getCreatureSummons(challenger)[1]) challenger_turn = challenger_turn + 1 afk_time = 0 end else afk_time = afk_time + 0.5 end end if afk_time > afk_limit_time then setPlayerStorageValue(focus, 990, -1) focus = 0 selfSay("I have waited too long, come back when you are ready!") return true end if not afk_warning and afk_time > afk_limit_time / 2 then selfSay("Where's your pokemon? Let's fight!") afk_warning = true end if #getCreatureSummons(getThis()) == 0 then if battle_turn > #pokemons then addEvent(doWinDuel, 1000, focus, getThis()) setPlayerStorageValue(focus, 990, -1) focus = 0 return true end addEvent(doSummonGymPokemon, 1000, getThis()) end if not hasPokemon(challenger) or challenger_turn >= 7 or challenger_turn > #pokemons then selfSay("You lost our duel! Maybe some other time you'll defeat me.") setPlayerStorageValue(focus, 990, -1) focus = 0 return true end end local npcpos = getThingPos(getThis()) local focpos = getThingPos(focus) if npcpos.z ~= focpos.z then setPlayerStorageValue(focus, 990, -1) focus = 0 selfSay("Bye then.") return true end if (os.clock() - talk_start) > 30 then selfSay("Good bye and keep training!") setPlayerStorageValue(focus, 990, -1) focus = 0 end if getDistanceToCreature(focus) > max_distance then setPlayerStorageValue(focus, 990, -1) focus = 0 return true end local dir = doRedirectDirection(getDirectionTo(npcpos, focpos)) selfTurn(dir) end return true end
Bom como testei so um mas creio eu que esteja todos BUGADOS meus npcs de GYM.
Quem puder ajuda com este bug e poder me passa a tag ou a linha da solução ^^
Rep+++
-
15 minutos atrás, Yan18 disse:
Vai no remere's, abre o seu mapa e vai no baú onde está os pokémons, depois adicione o seguinte actiondId em todos os baús: 18777 (Pode ser outro de sua preferência, mas tem que ser o mesmo para todos os baús).
Agora em Data/Actions/Scripts crie um arquivo chamado start.lua e adicione todo o seguinte código dentro:
local starterpokes = { ["Bulbasaur"] = {x = 1009, y = 1009, z = 7}, ["Charmander"] = {x = 1012, y = 1009, z = 7}, ["Squirtle"] = {x = 1015, y = 1009, z = 7}, } local itens = { [2394] = 20, [2152] = 10, [12346] = 5, [12344] = 5, } local btype = "Icone" local storage = 77477 local cities = { ["Saffron"] = 1, ["Cerulean"] = 2, ["Lavender"] = 3, ["Fuchsia"] = 4, ["Celadon"] = 5, ["Viridian"] = 6, ["Pallet"] = 7, ["Pewter"] = 8, ["Vermilion"] = 9, ["Cinabar"] = 10, } ---------------------------------------- CÓDIGO ------------------------------------ function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, storage) < 1 then local pokemon = "" for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then return true end doPlayerSendTextMessage(cid,22,"Boa escolha. Divirta-se!") addPokeToPlayer(cid, pokemon, 0, nil, btype, true) setPlayerStorageValue(cid, 8955, 1) nome_pokemon = pokemon for i, j in pairs(itens) do doPlayerAddItem(cid, i, j) end doPlayerSetTown(cid, cities["Saffron"]) -- COLOCA O NOME DA CIDADE QUE QUER QUE SEJA CIDADE NATAL doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 40) doSendMagicEffect(getThingPos(cid), 7) setPlayerStorageValue(cid, storage, 1) return true else doPlayerSendTextMessage(cid, 27, "Você já escolheu seu pokémon!") return true end return TRUE end
E salve o arquivo com a codificação ANSI, senão vai aparecer caracteres inválidos no chat porque coloquei palavras com acento.
*OBS: Criei um novo arquivo para manter o outro como backup e para ficar mais organizado. E também com um nome melhor rs.
Agora em Data/Actions/ abra o Actions.xml, procure por essa tag:
<action actionid="1740" event="script" value="IniciasPokes.lua"/>
E comente ela (Em xml é <!-- -->), e embaixo adicione essa tag:
<action actionid="18777" event="script" value="start.lua"/> <!-- COLOQUE O ID DA ACTIONID DO REMERES -->
Não esquece de adicionar os outros pokémon na tabela, eu deixei só 3 para teste, adicione o restante com suas devidas localizações.
Eu testei aqui e deu certo, e não esqueça de salvar o actionId pelo remere's.
Testa e me fala.
Foi pego \o/
Valeuu amigo ^^
Rep+++
-
4 minutos atrás, Yan18 disse:
Faz um último teste e faço por action para você, substitua o código por esse:
local starterpokes = { ["Bulbasaur"] = {x = 143, y = 110, z = 6}, ["Chikorita"] = {x = 144, y = 110, z = 6}, ["Treecko"] = {x = 145, y = 110, z = 6}, ["Turtwig"] = {x = 146, y = 110, z = 6}, ["Snivy"] = {x = 147, y = 110, z = 6}, ["Charmander"] = {x = 148, y = 110, z = 6}, ["Cyndaquil"] = {x = 149, y = 110, z = 6}, ["Torchic"] = {x = 150, y = 110, z = 6}, ["Chimchar"] = {x = 151, y = 110, z = 6}, ["Tepig"] = {x = 152, y = 110, z = 6}, ["Squirtle"] = {x = 153, y = 110, z = 6}, ["Totodile"] = {x = 154, y = 110, z = 6}, ["Mudkip"] = {x = 155, y = 110, z = 6}, ["Piplup"] = {x = 156, y = 110, z = 6}, ["Oshawott"] = {x = 157, y = 110, z = 6}, } local itens = { [2394] = 20, [2152] = 10, [12346] = 5, [12344] = 5, } local btype = "Icone" local storage = 77477 local cities = { ["Saffron"] = 1, ["Cerulean"] = 2, ["Lavender"] = 3, ["Fuchsia"] = 4, ["Celadon"] = 5, ["Viridian"] = 6, ["Pallet"] = 7, ["Pewter"] = 8, ["Vermilion"] = 9, ["Cinabar"] = 10, } ---------------------------------------- CÓDIGO ------------------------------------ function onUse(cid, item, frompos, item2, topos) local pokemon = "" for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then return true end doPlayerSendTextMessage(cid,22,"Boa escolha. Divirta-se!") addPokeToPlayer(cid, pokemon, 0, nil, btype, true) setPlayerStorageValue(cid, 8955, 1) nome_pokemon = pokemon for i, j in pairs(itens) do doPlayerAddItem(cid, i, j) end doPlayerSetTown(cid, cities["Saffron"]) -- COLOCA O NOME DA CIDADE QUE QUER QUE SEJA CIDADE NATAL doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 40) doSendMagicEffect(getThingPos(cid), 7) setPlayerStorageValue(cid, storage, 1) return TRUE end
Testa e me fala.
nada =/
-
12 minutos atrás, Yan18 disse:
Substitui todo seu código por esse:
local starterpokes = { ["Bulbasaur"] = {x = 143, y = 110, z = 6}, ["Chikorita"] = {x = 144, y = 110, z = 6}, ["Treecko"] = {x = 145, y = 110, z = 6}, ["Turtwig"] = {x = 146, y = 110, z = 6}, ["Snivy"] = {x = 147, y = 110, z = 6}, ["Charmander"] = {x = 148, y = 110, z = 6}, ["Cyndaquil"] = {x = 149, y = 110, z = 6}, ["Torchic"] = {x = 150, y = 110, z = 6}, ["Chimchar"] = {x = 151, y = 110, z = 6}, ["Tepig"] = {x = 152, y = 110, z = 6}, ["Squirtle"] = {x = 153, y = 110, z = 6}, ["Totodile"] = {x = 154, y = 110, z = 6}, ["Mudkip"] = {x = 155, y = 110, z = 6}, ["Piplup"] = {x = 156, y = 110, z = 6}, ["Oshawott"] = {x = 157, y = 110, z = 6}, } local itens = { [2394] = 20, [2152] = 10, [12346] = 5, [12344] = 5, } local btype = "Icone" local storage = 77477 local cities = { ["Saffron"] = 1, ["Cerulean"] = 2, ["Lavender"] = 3, ["Fuchsia"] = 4, ["Celadon"] = 5, ["Viridian"] = 6, ["Pallet"] = 7, ["Pewter"] = 8, ["Vermilion"] = 9, ["Cinabar"] = 10, } ---------------------------------------- CÓDIGO ------------------------------------ function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, storage) < 1 then local pokemon = "" for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then return true end doPlayerSendTextMessage(cid,22,"Boa escolha. Divirta-se!") addPokeToPlayer(cid, pokemon, 0, nil, btype, true) setPlayerStorageValue(cid, 8955, 1) nome_pokemon = pokemon for i, j in pairs(itens) do doPlayerAddItem(cid, i, j) end doPlayerSetTown(cid, cities["Saffron"]) -- COLOCA O NOME DA CIDADE QUE QUER QUE SEJA CIDADE NATAL doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 40) doSendMagicEffect(getThingPos(cid), 7) setPlayerStorageValue(cid, storage, 1) return true else doPlayerSendTextMessage(cid, 27, "Você já escolheu seu pokémon!") return true end return TRUE end
Testa e me fala.
Nao vai sei la pq e ja tudo CERTO.
Acredito eu que va da certo e com a ACTION no bau.
-
5 minutos atrás, Yan18 disse:
Cara, estranho porque eu testei aqui e funcionou com o mesmo script que fiz para você.
Como pode ver, o player recebeu os 4 itens que você quer e recebeu o pokémon normalmente. Você deve ter feito alguma coisa errada no script ou no xml.
Sobre a action do baú, pode fazer até pode, mas não tem necessidade já que da para fazer no script. Mas se quiser eu faço, mas não acho que seja melhor opção, até porque como mostrei ai na print, ta funcionando normal.
sei la aqui nao pego vo ate revisa mais nao foi sei la oque deu nao deu erro nem nada
-
38 minutos atrás, Yan18 disse:
Ok.
E nao funcionou.
Ele abre o bau nao ganha item e nao e teleportado ele abre o bau nao tem nada e ele fica no lugar!!
E no exe do server nao tem ERRO.
Eu pensei se teria como nesse script coloca uma action no bau creio eu que a chance de funciona seria melhor.
-
1 hora atrás, Yan18 disse:
Pronto, já adicionei os itens que quer e criei uma tabela para cidade ao teleportar o player quando clica no baú:
local starterpokes = { ["Bulbasaur"] = {x = 143, y = 110, z = 6}, ["Chikorita"] = {x = 144, y = 110, z = 6}, ["Treecko"] = {x = 145, y = 110, z = 6}, ["Turtwig"] = {x = 146, y = 110, z = 6}, ["Snivy"] = {x = 147, y = 110, z = 6}, ["Charmander"] = {x = 148, y = 110, z = 6}, ["Cyndaquil"] = {x = 149, y = 110, z = 6}, ["Torchic"] = {x = 150, y = 110, z = 6}, ["Chimchar"] = {x = 151, y = 110, z = 6}, ["Tepig"] = {x = 152, y = 110, z = 6}, ["Squirtle"] = {x = 153, y = 110, z = 6}, ["Totodile"] = {x = 154, y = 110, z = 6}, ["Mudkip"] = {x = 155, y = 110, z = 6}, ["Piplup"] = {x = 156, y = 110, z = 6}, ["Oshawott"] = {x = 157, y = 110, z = 6}, } local itens = { [2394] = 20, [2152] = 10, [12346] = 5, [12344] = 5, } local btype = "Icone" local storage = 77477 local cities = { ["Saffron"] = 1, ["Cerulean"] = 2, ["Lavender"] = 3, ["Fuchsia"] = 4, ["Celadon"] = 5, ["Viridian"] = 6, ["Pallet"] = 7, ["Pewter"] = 8, ["Vermilion"] = 9, ["Cinabar"] = 10, } ---------------------------------------- CÓDIGO ------------------------------------ function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, storage) < 1 then local pokemon = "" for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then return true end doPlayerSendTextMessage(cid,22,"Boa escolha. Divirta-se!") addPokeToPlayer(cid, pokemon, 0, nil, btype, true) setPlayerStorageValue(cid, 8955, 1) nome_pokemon = pokemon for i, j in pairs(itens) do doPlayerAddItem(cid, i, j) end doPlayerSetTown(cid, cities["Saffron"]) -- COLOCA O NOME DA CIDADE QUE QUER QUE SEJA CIDADE NATAL doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 40) doSendMagicEffect(getThingPos(cid), 7) setPlayerStorageValue(cid, storage, 1) return true else doPlayerSendTextMessage(cid, 27, "Você já escolheu seu pokémon!") return true end return TRUE end
Testei tanto em Saffron como em Cerulean e deu certo, caso queira trocar a cidade do player ao pegar o pokemon, só colocar o nome da cidade ali dentro de cities de acordo com as cidades existente na tabela. Caso queira colocar mais cidades além daquelas, vai em data/talkactions/script/tele.lua e olha lá todas as cidades e coloca na ordem igual está lá na tabela, mas se criou outra cidade pelo remere's, só olhar o id da town lá.
OBS: Se você está usando o mapa padrão do PokeRoxy, pode ver que tem um baú dourado no começo, ali está dando alguns itens, para tirar, só ir em data/actions/scripts/quests/itensiniciais.lua e remover os itens lá, na verdade se quiser pode até tirar aquele script de actions.xml, só comentar a tag dele.
Testei aqui e deu certo, mas qualquer problema me fale.
Bom testei!!
E nao funcionou.
Ele abre o bau nao ganha item e nao e teleportado ele abre o bau nao tem nada e ele fica no lugar!!
E no exe do server nao tem ERRO.
Eu pensei se teria como nesse script coloca uma action no bau creio eu que a chance de funciona seria melhor.
Tipo uma action na script que colocava no bau
-
43 minutos atrás, Yan18 disse:
Me passa o id de todos os itens e a quantidade referente a eles que eu adicione para você e nas próximas você faz seguindo como eu fiz.
Sobre a cidade, ele ali ta passando a town para onde está salvo o templo que cria conta. Mas, para adicionar todas as towns ou outra, tem que ir no remere's e pegar o id delas, acho que o atalho é CTRL+T, geralmente Saffron é 1.
Ata!!!
Bom sao 4 itens.
ID: 2394 , 20
ID: 2152 , 10
ID: 12346 , 5
ID: 12344 , 5
-
9 horas atrás, Yan18 disse:
local starterpokes = { ["Bulbasaur"] = {x = 1357, y = 990, z = 10}, ["Chikorita"] = {x = 1356, y = 990, z = 10}, ["Treecko"] = {x = 1355, y = 990, z = 10}, ["Turtwig"] = {x = 1354, y = 990, z = 10}, ["Snivy"] = {x = 1353, y = 990, z = 10}, ["Charmander"] = {x = 1347, y = 990, z = 10}, ["Cyndaquil"] = {x = 1346, y = 990, z = 10}, ["Torchic"] = {x = 1345, y = 990, z = 10}, ["Chimchar"] = {x = 1344, y = 990, z = 10}, ["Tepig"] = {x = 1343, y = 990, z = 10}, ["Squirtle"] = {x = 1367, y = 990, z = 10}, ["Totodile"] = {x = 1366, y = 990, z = 10}, ["Mudkip"] = {x = 1365, y = 990, z = 10}, ["Piplup"] = {x = 1364, y = 990, z = 10}, ["Oshawott"] = {x = 1363, y = 990, z = 10}, } local btype = "Icone" -- COLOCA OS ITENS NA TABELA, O ÍNDICE É O ID DO ITEM E O VALOR A QUANTIDADE -- local itens = { [id_item1] = quantidade, [id_item2] = quantidade, } local storage = 77477 -- STORAGE PARA NÃO PEGAR MAIS DE 1 POKÉMON ------------ CÓDIGO -------------- function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, storage) < 1 then local pokemon = "" for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then return true end doPlayerSendTextMessage(cid,22,"Boa Escolha") addPokeToPlayer(cid, pokemon, 0, nil, btype, true) setPlayerStorageValue(cid, 8955, 1) doSendMagicEffect(getThingPos(cid), 29) for i, j in pairs(itens) do doPlayerAddItem(cid, i, j) end doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 40) doSendMagicEffect(getThingPos(cid), 7) setPlayerStorageValue(cid, storage, 1) return true else doPlayerSendTextMessage(cid, 27, "Você já escolheo o " ..pokemon.. " como seu pokémon!") return true end return TRUE end
Testa e me fala! Lembre de trocar os id e quantidade dos itens ali na tabela.
Bom pelo que entendi o ID do item coloca dentro da tabela e a quantia fora da tabela ??
E haa onde que ta a localização de saffron so pra saber mesmo ??
-
4 minutos atrás, Yan18 disse:
Sim, consigo. Estou fazendo aqui, você quer que vá para Saffron a cidade que já está indo ao criar a conta ou quer outra cidade e ao teleportar torne aquela cidade a natal do player?
Sim isso Saffron ^^
-
2 minutos atrás, Yan18 disse:
Estou usando essa base recentemente e pelo que vi não tem unique system. Mas baixei ontem, estou conhecendo e qualquer coisa te aviso.
Beleza ^^
Mas tu consegui por itens nessa script e city inicial nela ??
Tipo clico no bau ganha o pokemon e X item e vai tipo pra saffron
-
21 minutos atrás, Yan18 disse:
Qual base você está usando?
PokeRoxy Creio eu que seja DXP
-
2 horas atrás, R e d disse:
ve se da algum erro
local starterpokes = {
["Bulbasaur"] = {x = 1357, y = 990, z = 10},
["Chikorita"] = {x = 1356, y = 990, z = 10},
["Treecko"] = {x = 1355, y = 990, z = 10},
["Turtwig"] = {x = 1354, y = 990, z = 10},
["Snivy"] = {x = 1353, y = 990, z = 10},
["Charmander"] = {x = 1347, y = 990, z = 10},
["Cyndaquil"] = {x = 1346, y = 990, z = 10},
["Torchic"] = {x = 1345, y = 990, z = 10},
["Chimchar"] = {x = 1344, y = 990, z = 10},
["Tepig"] = {x = 1343, y = 990, z = 10},
["Squirtle"] = {x = 1367, y = 990, z = 10},
["Totodile"] = {x = 1366, y = 990, z = 10},
["Mudkip"] = {x = 1365, y = 990, z = 10},
["Piplup"] = {x = 1364, y = 990, z = 10},
["Oshawott"] = {x = 1363, y = 990, z = 10},
}local btype = "Icone"
function onUse(cid, item, frompos, item2, topos)
local pokemon = ""
for a, b in pairs (starterpokes) do
if isPosEqualPos(topos, b) then
pokemon = a
end
end
if pokemon == "" then return true end
doPlayerSendTextMessage(cid,22,"Boa Escolha")
doPlayerAddItem(cid, 18752, 1) -- Id do item, quantiaaddPokeToPlayer(cid, pokemon, 0, nil, btype, true)
setPlayerStorageValue(cid, 8955, 1)doSendMagicEffect(getThingPos(cid), 29)
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doTeleportThing(cid,{x=375, y=1516, z=7})
doSendMagicEffect(getThingPos(cid), 40)
doSendMagicEffect(getThingPos(cid), 7)
return TRUE
endNao deu erro porem nao funcionou =/
-
3 minutos atrás, R e d disse:
Função que adiciona item ao player apos clicar no bau:
doPlayerAddItem(cid, 18752, 1) -- Id do item, quantia
Função que teleporta o player para determinada posição
doTeleportThing(cid,{x=375, y=1516, z=7})mas onde posso por na script ??
-
Bom preciso de uma ajuda em uma script aqui.
Bom ela e uma script de Kit Inicial de pokemon.
Oque eu queria e se tem como por nela um kit inicial de 3 a 4 items se possivel com a tag unique.
E queria por uma posição onde o player clica no bau e pra pra uma determinada area.
Tipo:
Cara clica no bau e vai pra saffron tipo saffron se torna sua city inicial.
Clico no bau pego o charmander e foi direto pra saffron ( city inicial)
SCRIPT
local starterpokes = { ["Bulbasaur"] = {x = 1357, y = 990, z = 10}, ["Chikorita"] = {x = 1356, y = 990, z = 10}, ["Treecko"] = {x = 1355, y = 990, z = 10}, ["Turtwig"] = {x = 1354, y = 990, z = 10}, ["Snivy"] = {x = 1353, y = 990, z = 10}, ["Charmander"] = {x = 1347, y = 990, z = 10}, ["Cyndaquil"] = {x = 1346, y = 990, z = 10}, ["Torchic"] = {x = 1345, y = 990, z = 10}, ["Chimchar"] = {x = 1344, y = 990, z = 10}, ["Tepig"] = {x = 1343, y = 990, z = 10}, ["Squirtle"] = {x = 1367, y = 990, z = 10}, ["Totodile"] = {x = 1366, y = 990, z = 10}, ["Mudkip"] = {x = 1365, y = 990, z = 10}, ["Piplup"] = {x = 1364, y = 990, z = 10}, ["Oshawott"] = {x = 1363, y = 990, z = 10}, } local btype = "Icone" function onUse(cid, item, frompos, item2, topos) local pokemon = "" for a, b in pairs (starterpokes) do if isPosEqualPos(topos, b) then pokemon = a end end if pokemon == "" then return true end doPlayerSendTextMessage(cid,22,"Boa Escolha") addPokeToPlayer(cid, pokemon, 0, nil, btype, true) setPlayerStorageValue(cid, 8955, 1) doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 40) doSendMagicEffect(getThingPos(cid), 7) return TRUE end
Quem puder ajudar ^^
Rep+++
-
15 minutos atrás, BruninhoGamerBR disse:
Alguém sabe Aonde modifica quando o Player criar a conta vai estar em uma determinada area
Bom amigo se for SQL e na conf.lua se eu nao me engano.
accountManager = true namelockManager = true newPlayerChooseVoc = false newPlayerSpawnPosX = 151 newPlayerSpawnPosY = 133 newPlayerSpawnPosZ = 6 newPlayerTownId = 1 newPlayerLevel = 10 newPlayerMagicLevel = 0 generateAccountNumber = false
Ai se tu quer dizer apos o player pega o pokemon inicial
Fica em actions/scripts/IniciasPokes.lua
["Bulbasaur"] = {x = 143, y = 110, z = 6}, ["Chikorita"] = {x = 144, y = 110, z = 6}, ["Treecko"] = {x = 145, y = 110, z = 6},
Se for mysql ai ja nao sei!!!
-
5 horas atrás, Bingao disse:
eae bom dia, faz mo tempo que n abro servidor e to meio por fora das novidades(sou do tempos de 2010 2011 2012) entao queria um breve resumo do servidor e se tem como me ajuda (via discord) e coloca sistema unicos q eu lembro q tinha no pxg ou no antigo P.O, claro se puder fazer isso fico grato
meu discord:BingaoYT#4052Bom amigo!!!
O server tipo tem sistemas que tem no PDA.
- Sistema de clan
- Pelo que vi tem outland
Assim tem sistemas que tem no pda.
Bom sobre ajuda em sistemas e talz...
E bom tu monta uma equipe sei la faz uma equipe monta uma e cria sistemas sei la mapa sprites sei la
-
Alguem descobriu.
[16/03/2020 01:28:37] [Warning - Items::loadFromXml] No itemid found [16/03/2020 01:28:37] [Warning - Items::loadFromXml] No itemid found
Os itens que estao sem função que sao dois itens ??
-
2 horas atrás, adrianokk disse:
Alguém ta conseguindo abrir o mapa editor sem erros !?
Bom e so configura normal eu mesmo consigo normal e so configura normal que da certo eu mesmo consigo!!!
15 horas atrás, evandropk disse:Onde tá a Sql do servidor?
se for o programa nao vem e so abaixa na net sql tem um site deles mesmo e la so baixa o programa.
Site: https://sqlitestudio.pl/index.rvt?act=download
Caso for o programa SQL
-
3 horas atrás, 161996 disse:
Galera não sei se voces repararam mas os pokemons selvagens não tão dando dano nas spells deles, somente no ataque básico!!!
Alguém conseguiu arrumar isso? Passou despercebidoPse tbem queria ajuda nisso!!!
Seria bom se alguem reslver ou ajuda posta aqui a solução assim ajudava todos ^^
-
1 hora atrás, hunter3522 disse:
database seria "pokeroxy" ? é a q ja esta
Sim isso vc usa o nome da que vc ta usando se e este o nome e isso sim e so muda ali ^^
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
Bug NPC GYM
em Scripts
Postado
Deu esse ERRO