Ir para conteúdo
  • 0

Ajuda Na Script


kriller12

Pergunta

Olá, preciso de uma modificação nessa script aqui.

Bom esse script é da minha nurse joy.

Aqui você só diz: hi ,ai ela heala seus pokemons só que: eu queria que o player tivesse que dizer:

 

Player: hi

Nurse: Olá, diga heal para healar seus pokemons.

Player: heal

Nurse: Pronto você já pode ir.

 

Aqui está a minha script da nurse: rules.gif

 

local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local talkState = {}
local states = {'1', '2', '3', '4', '5', '6'}
local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151}
local unlock = {}
local pokeballs = {'2222', '2224'}
local ultraballs = {'2220', '2227'}
local greatballs = {'2651', '2657'}
local superballs = {'2653', '2658'}
local saffariballs = {'2655', '2659'}


function onThingMove(creature, thing, oldpos, oldstackpos)



end





function onCreatureAppear(creature)



end





function onCreatureDisappear(cid, pos)
if focus == cid then

selfSay("Good bye!", cid)

focus = 0

talk_start = 0

end

end





function onCreatureTurn(creature)



end





function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end



function onCreatureSay(cid, type, msg)
local msg = string.lower(msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if((msgcontains(msg, 'hi') or msgcontains(msg, 'heal') or msgcontains(msg, 'help')) and (getDistanceToCreature(cid) <= 3)) then
if exhaustion.get(cid, 9211) then
selfSay("Please wait a few moment before asking me to heal your pokemons again!", cid)
return true
end
exhaustion.set(cid, 9211, 5)
doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
doSendMagicEffect(getThingPos(cid), 132)
if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2222)
end
if isInArray(ultraballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2220)
end
if isInArray(greatballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2651)
end
if isInArray(superballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2653)
end
if isInArray(saffariballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
doTransformItem(feet.uid, 2655)
end
local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
if #getCreatureSummons(cid) >= 1 then
local jui = getCreatureSummons(cid)[1]
doCreatureAddHealth(jui, getCreatureMaxHealth(jui)-getCreatureHealth(jui))
doSendMagicEffect(getThingPos(jui), 132)
end
local items = getItemsInContainerById(bp.uid, 2224)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
doTransformItem(uid, 2222)
end
local items = getItemsInContainerById(bp.uid, 2227)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
doTransformItem(uid, 2220)
end
local items = getItemsInContainerById(bp.uid, 2657)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
doTransformItem(uid, 2651)
end
local items = getItemsInContainerById(bp.uid, 2658)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
doTransformItem(uid, 2653)
end
local items = getItemsInContainerById(bp.uid, 2659)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
doTransformItem(uid, 2655)
end
local items = getItemsInContainerById(bp.uid, 2222)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
end
local items = getItemsInContainerById(bp.uid, 2220)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
end
local items = getItemsInContainerById(bp.uid, 2651)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
end
local items = getItemsInContainerById(bp.uid, 2653)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
end
local items = getItemsInContainerById(bp.uid, 2655)
for _, uid in pairs(items) do
local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
end
selfSay("There you go! You and your pokemons are healthy again.", cid)
end
end

function onThink()

if focus ~= 0 then
a, b, c = selfGetPosition()
if c ~= getThingPos(focus).z then
focus = 0
end
end

if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
focus = 0
end
end

return true
end

 

 

Alguem pode modificar para mim? valendo 3 Rep+

Editado por kriller12
Link para o comentário
Compartilhar em outros sites

15 respostass a esta questão

Posts Recomendados

  • 0

Não se vai funcionar e se funcionar acho que se o jogador falar heal ele vai heala

sem precisa fala hi primeiro.. não sei mexe com npcs :/... espera uma resposta de alguém que saiba.

 

 

 

local focus = 0

 

local talk_start = 0

 

local target = 0

 

local following = false

 

local attacking = false

 

local talkState = {}

local states = {'1', '2', '3', '4', '5', '6'}

local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151}

local unlock = {}

local pokeballs = {'2222', '2224'}

local ultraballs = {'2220', '2227'}

local greatballs = {'2651', '2657'}

local superballs = {'2653', '2658'}

local saffariballs = {'2655', '2659'}

 

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

 

 

end

 

 

 

 

 

function onCreatureAppear(creature)

 

 

 

end

 

 

 

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

 

selfSay("Good bye!", cid)

 

focus = 0

 

talk_start = 0

 

end

 

end

 

 

 

 

 

function onCreatureTurn(creature)

 

 

 

end

 

 

 

 

 

function msgcontains(txt, str)

 

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

 

end

 

 

 

function onCreatureSay(cid, type, msg)

local msg = string.lower(msg)

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'hi') then

selfSay("Diga heal para healar seus pokemons.", cid)

return true

end

if msgcontains(msg, 'heal') then

if exhaustion.get(cid, 9211) then

selfSay("Please wait a few moment before asking me to heal your pokemons again!", cid)

return true

end

end

exhaustion.set(cid, 9211, 5)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))

doSendMagicEffect(getThingPos(cid), 132)

if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2222)

end

if isInArray(ultraballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2220)

end

if isInArray(greatballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2651)

end

if isInArray(superballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2653)

end

if isInArray(saffariballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2655)

end

local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)

if #getCreatureSummons(cid) >= 1 then

local jui = getCreatureSummons(cid)[1]

doCreatureAddHealth(jui, getCreatureMaxHealth(jui)-getCreatureHealth(jui))

doSendMagicEffect(getThingPos(jui), 132)

end

local items = getItemsInContainerById(bp.uid, 2224)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2222)

end

local items = getItemsInContainerById(bp.uid, 2227)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2220)

end

local items = getItemsInContainerById(bp.uid, 2657)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2651)

end

local items = getItemsInContainerById(bp.uid, 2658)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2653)

end

local items = getItemsInContainerById(bp.uid, 2659)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2655)

end

local items = getItemsInContainerById(bp.uid, 2222)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2220)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2651)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2653)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2655)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

selfSay("There you go! You and your pokemons are healthy again.", cid)

end

 

function onThink()

 

if focus ~= 0 then

a, b, c = selfGetPosition()

if c ~= getThingPos(focus).z then

focus = 0

end

end

 

if focus ~= 0 then

if getDistanceToCreature(focus) > 3 then

focus = 0

end

end

 

return true

end

 

 

 

 

Script editada.

Editado por Vilden
Link para o comentário
Compartilhar em outros sites

  • 0

Muito bom lek, muito bom msm mdr.gif

sem sombra de dúvida rep+ por 3 dias!!

 

você pode me explicar como faz isso que você fez?

 

é pq tenho varios npc's e eu acho chato fica postando todos aqui para perdir que altere-os.

Editado por kriller12
Link para o comentário
Compartilhar em outros sites

  • 0

Veio eu adicionei uma tag pra ele falar hi e aparece uma mensagem, logo botei pra retorna (return true)

e então ele fala heal e funciona como hi..

 

Se a pessoa chegar e fala heal, sem falar hi funciona também..

 

Não sei mecher bem com npcs :/

_________

Dificil explicar..

Link para o comentário
Compartilhar em outros sites

  • 0

nuss não havia reparado + o npc bugou nem precisa falar nada com ela,basta chegar perto e soltar o poke q ela heala "-" .

tem como consertar isso?

 

 

Obs: se você não sober como consertar, não tem problema vou torcer pro vodkart ver o tópico, talvez ele pode resolver.

Link para o comentário
Compartilhar em outros sites

  • 0

Testa agora..

 

 

local focus = 0

 

local talk_start = 0

 

local target = 0

 

local following = false

 

local attacking = false

 

local talkState = {}

local states = {'1', '2', '3', '4', '5', '6'}

local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151}

local unlock = {}

local pokeballs = {'2222', '2224'}

local ultraballs = {'2220', '2227'}

local greatballs = {'2651', '2657'}

local superballs = {'2653', '2658'}

local saffariballs = {'2655', '2659'}

 

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

 

 

end

 

 

 

 

 

function onCreatureAppear(creature)

 

 

 

end

 

 

 

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

 

selfSay("Good bye!", cid)

 

focus = 0

 

talk_start = 0

 

end

 

end

 

 

 

 

 

function onCreatureTurn(creature)

 

 

 

end

 

 

 

 

 

function msgcontains(txt, str)

 

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

 

end

 

 

 

function onCreatureSay(cid, type, msg)

local msg = string.lower(msg)

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'hi') and getDistanceToCreature(cid) <= 3 then

selfSay("Diga heal para healar seu pokemon!", cid)

elseif msgcontains(msg, 'heal') and getDistanceToCreature(cid) <= 3 then

if exhaustion.get(cid, 9211) then

selfSay("Please wait a few moment before asking me to heal your pokemons again!", cid)

return true

end

exhaustion.set(cid, 9211, 5)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))

doSendMagicEffect(getThingPos(cid), 132)

if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2222)

end

if isInArray(ultraballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2220)

end

if isInArray(greatballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2651)

end

if isInArray(superballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2653)

end

if isInArray(saffariballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2655)

end

local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)

if #getCreatureSummons(cid) >= 1 then

local jui = getCreatureSummons(cid)[1]

doCreatureAddHealth(jui, getCreatureMaxHealth(jui)-getCreatureHealth(jui))

doSendMagicEffect(getThingPos(jui), 132)

end

local items = getItemsInContainerById(bp.uid, 2224)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2222)

end

local items = getItemsInContainerById(bp.uid, 2227)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2220)

end

local items = getItemsInContainerById(bp.uid, 2657)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2651)

end

local items = getItemsInContainerById(bp.uid, 2658)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2653)

end

local items = getItemsInContainerById(bp.uid, 2659)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2655)

end

local items = getItemsInContainerById(bp.uid, 2222)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2220)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2651)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2653)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2655)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

selfSay("There you go! You and your pokemons are healthy again.", cid)

end

end

 

function onThink()

 

if focus ~= 0 then

a, b, c = selfGetPosition()

if c ~= getThingPos(focus).z then

focus = 0

end

end

 

if focus ~= 0 then

if getDistanceToCreature(focus) > 3 then

focus = 0

end

end

 

return true

end

 

 

Link para o comentário
Compartilhar em outros sites

  • 0

Não reportei o tópico, assim alguém mais especializado pode deixar 100% pra você.

 

se quiser testar, teste essa pra ve se arruma esse bug.

 

 

local focus = 0

 

local talk_start = 0

 

local target = 0

 

local following = false

 

local attacking = false

 

local talkState = {}

local states = {'1', '2', '3', '4', '5', '6'}

local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151}

local unlock = {}

local pokeballs = {'2222', '2224'}

local ultraballs = {'2220', '2227'}

local greatballs = {'2651', '2657'}

local superballs = {'2653', '2658'}

local saffariballs = {'2655', '2659'}

 

 

function onThingMove(creature, thing, oldpos, oldstackpos)

 

 

 

end

 

 

 

 

 

function onCreatureAppear(creature)

 

 

 

end

 

 

 

 

 

function onCreatureDisappear(cid, pos)

if focus == cid then

 

selfSay("Good bye!", cid)

 

focus = 0

 

talk_start = 0

 

end

 

end

 

 

 

 

 

function onCreatureTurn(creature)

 

 

 

end

 

 

 

 

 

function msgcontains(txt, str)

 

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

 

end

 

 

 

function onCreatureSay(cid, type, msg)

local msg = string.lower(msg)

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

if msgcontains(msg, 'hi') and getDistanceToCreature(cid) <= 3 then

selfSay("Diga heal para healar seu pokemon!", cid)

elseif msgcontains(msg, 'heal') and getDistanceToCreature(cid) <= 3 and NPCHANDLER_CONVBEHAVIOR == true then

if exhaustion.get(cid, 9211) then

selfSay("Please wait a few moment before asking me to heal your pokemons again!", cid)

return true

end

exhaustion.set(cid, 9211, 5)

doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))

doSendMagicEffect(getThingPos(cid), 132)

if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2222)

end

if isInArray(ultraballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2220)

end

if isInArray(greatballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2651)

end

if isInArray(superballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2653)

end

if isInArray(saffariballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then

local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)

local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))

doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))

doTransformItem(feet.uid, 2655)

end

local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)

if #getCreatureSummons(cid) >= 1 then

local jui = getCreatureSummons(cid)[1]

doCreatureAddHealth(jui, getCreatureMaxHealth(jui)-getCreatureHealth(jui))

doSendMagicEffect(getThingPos(jui), 132)

end

local items = getItemsInContainerById(bp.uid, 2224)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2222)

end

local items = getItemsInContainerById(bp.uid, 2227)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2220)

end

local items = getItemsInContainerById(bp.uid, 2657)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2651)

end

local items = getItemsInContainerById(bp.uid, 2658)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2653)

end

local items = getItemsInContainerById(bp.uid, 2659)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

doTransformItem(uid, 2655)

end

local items = getItemsInContainerById(bp.uid, 2222)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2220)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2651)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2653)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

local items = getItemsInContainerById(bp.uid, 2655)

for _, uid in pairs(items) do

local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))

doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))

end

selfSay("There you go! You and your pokemons are healthy again.", cid)

end

end

 

function onThink()

 

if focus ~= 0 then

a, b, c = selfGetPosition()

if c ~= getThingPos(focus).z then

focus = 0

end

end

 

if focus ~= 0 then

if getDistanceToCreature(focus) > 3 then

focus = 0

end

end

 

return true

end

 

Link para o comentário
Compartilhar em outros sites

  • 0
local focus = 0

local talk_start = 0

local target = 0

local following = false

local attacking = false

local talkState = {}
local states = {'1', '2', '3', '4', '5', '6'}
local store = {1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151}
local unlock = {}
local pokeballs = {'2222', '2224'}
local ultraballs = {'2220', '2227'}
local greatballs = {'2651', '2657'}
local superballs = {'2653', '2658'}
local saffariballs = {'2655', '2659'}


function onThingMove(creature, thing, oldpos, oldstackpos)



end





function onCreatureAppear(creature)



end





function onCreatureDisappear(cid, pos)
if focus == cid then

selfSay("Good bye!", cid)

focus = 0

talk_start = 0

end

end





function onCreatureTurn(creature)



end





function msgcontains(txt, str)

return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))

end



function onCreatureSay(cid, type, msg)

local msg = string.lower(msg)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
if msgcontains(msg, 'hi') and getDistanceToCreature(cid) <= 3 then
selfSay("Diga heal para healar seu pokemon!", cid)
talkState[talkUser] = 2

elseif talkState[talkUser] == 2 then
   if msgcontains(msg, 'heal') and getDistanceToCreature(cid) <= 3 then
       if exhaustion.get(cid, 9211) then
           selfSay("Please wait a few moment before asking me to heal your pokemons again!", cid)
       return true
       end

       exhaustion.set(cid, 9211, 5)
       doCreatureAddHealth(cid, getCreatureMaxHealth(cid)-getCreatureHealth(cid))
       doSendMagicEffect(getThingPos(cid), 132)

       if isInArray(pokeballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
           local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
           local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
           doTransformItem(feet.uid, 2222)
       end

       if isInArray(ultraballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
           local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
           local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
           doTransformItem(feet.uid, 2220)
       end

       if isInArray(greatballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
           local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
           local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
           doTransformItem(feet.uid, 2651)
       end

       if isInArray(superballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
           local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
           local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
           doTransformItem(feet.uid, 2653)
       end

       if isInArray(saffariballs, getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid) then
           local feet = getPlayerSlotItem(cid, CONST_SLOT_FEET)
           local maxh = tonumber(getItemAttribute(feet.uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(feet.uid, "poke", getItemAttribute(feet.uid, "poke"):sub(1, findLetter(getItemAttribute(feet.uid, "poke"), "[")) .. maxh .. getItemAttribute(feet.uid, "poke"):sub(findLetter(getItemAttribute(feet.uid, "poke"), "/")))
           doTransformItem(feet.uid, 2655)
       end

       local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)
       if #getCreatureSummons(cid) >= 1 then
           local jui = getCreatureSummons(cid)[1]
           doCreatureAddHealth(jui, getCreatureMaxHealth(jui)-getCreatureHealth(jui))
           doSendMagicEffect(getThingPos(jui), 132)
       end

       local items = getItemsInContainerById(bp.uid, 2224)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
           doTransformItem(uid, 2222)
       end

       local items = getItemsInContainerById(bp.uid, 2227)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
           doTransformItem(uid, 2220)
       end

       local items = getItemsInContainerById(bp.uid, 2657)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
           doTransformItem(uid, 2651)
       end

       local items = getItemsInContainerById(bp.uid, 2658)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
           doTransformItem(uid, 2653)
       end

       local items = getItemsInContainerById(bp.uid, 2659)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
           doTransformItem(uid, 2655)
       end

       local items = getItemsInContainerById(bp.uid, 2222)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
       end

       local items = getItemsInContainerById(bp.uid, 2220)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
       end

       local items = getItemsInContainerById(bp.uid, 2651)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
       end

       local items = getItemsInContainerById(bp.uid, 2653)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
       end

       local items = getItemsInContainerById(bp.uid, 2655)
       for _, uid in pairs(items) do
           local maxh = tonumber(getItemAttribute(uid, "poke"):match("/(.+)]"))
           doItemSetAttribute(uid, "poke", getItemAttribute(uid, "poke"):sub(1, findLetter(getItemAttribute(uid, "poke"), "[")) .. maxh .. getItemAttribute(uid, "poke"):sub(findLetter(getItemAttribute(uid, "poke"), "/")))
       end

       selfSay("There you go! You and your pokemons are healthy again.", cid)
   end
end

end

function onThink()

if focus ~= 0 then
a, b, c = selfGetPosition()
if c ~= getThingPos(focus).z then
focus = 0
end
end

if focus ~= 0 then
if getDistanceToCreature(focus) > 3 then
focus = 0
end
end

return true
end

Link para o comentário
Compartilhar em outros sites

  • 0

A edição do Jhon,quanto uma das ediçoes do Vilden estão iguais, pois mesmo chegando para ela e dizendo somenmte {heal} ela heala do mesmo jeito.

Mas vlw pela tentativa lek

Editado por kriller12
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...