Ir para conteúdo

Pergunta

Olá, sou novo aqui no Xtibia..

 

Uso como base o servidor LunusOt

Então, nesse ot o sistema da Nurse e do Revive não está como eu queria...

eu queria assim:

Eu falo Hi para a nurse e ela cura os 6 pokemons ( ja tem no servidor ) e também ''cura'' o status (Poison, sleep, etc... ) e os CD'S

mesma coisa com o revive, eu uso no poke morto e cura o status e o CD's

 

Alguem ai tem esse script ? ;D ,

 

Valendo REP button_ok.png

Thanks ^^

 

Olha os Scripts:

 

Nurse:

Data/Npc/Scripts/Nurse

 

local pokeballs = {

[1] = {effect = 188, on = 11826, use = 11827, off = 11828, all = {11826, 11827, 11828}},

[2] = {effect = 191, on = 11829, use = 11830, off = 11831, all = {11829, 11830, 11831}},

[3] = {effect = 190, on = 11835, use = 11836, off = 11837, all = {11835, 11836, 11837}},

[4] = {effect = 189, on = 11832, use = 11833, off = 11834, all = {11832, 11833, 11834}},

[5] = {effect = 188, on = 11737, use = 11738, off = 11739, all = {11737, 11738, 11739}},

[6] = {effect = 189, on = 11740, use = 11741, off = 11742, all = {11740, 11741, 11742}},

[7] = {effect = 190, on = 11743, use = 11744, off = 11745, all = {11743, 11744, 11745}},

[8] = {effect = 191, on = 11746, use = 11747, off = 11748, all = {11746, 11747, 11748}},

}

function onThingMove(creature, thing, oldpos, oldstackpos)

end

function onCreatureAppear(creature)

end

function onCreatureDisappear(cid, pos)

if focus == cid then

selfSay('Good bye sir!')

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

for a, b in pairs(gobackmsgs) do

local gm = string.gsub(b.go, "doka!", "")

local bm = string.gsub(b.back, "doka!", "")

if string.find(string.lower(msg), string.lower(gm)) or string.find(string.lower(msg), string.lower(bm)) then

return true

end

end

if((msgcontains(msg, 'hi') or msgcontains(msg, 'heal') or msgcontains(msg, 'help')) and (getDistanceToCreature(cid) <= 4)) then

if exhaustion.get(cid, 9211) then

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

return true

end

if not getTileInfo(getThingPos(cid)).protection and nurseHealsOnlyInPZ then

selfSay("Please, get inside the pokémon center to heal your pokemons!")

return true

end

exhaustion.set(cid, 9211, 5)

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

doCureStatus(cid, "all", true)

doSendMagicEffect(getThingPos(cid), 132)

local mypb = getPlayerSlotItem(cid, 8)

if #getCreatureSummons(cid) >= 1 then

if not nurseHealsPokemonOut then

selfSay("Please, return your pokemon to his ball!")

return true

end

local s = getCreatureSummons(cid)[1]

doCreatureAddHealth(s, getCreatureMaxHealth(s))

doSendMagicEffect(getThingPos(s), 13)

doCureStatus(s, "all", false)

if getPlayerStorageValue(s, 1008) < baseNurseryHappiness then

setPlayerStorageValue(s, 1008, baseNurseryHappiness)

end

if getPlayerStorageValue(s, 1009) > baseNurseryHunger then

setPlayerStorageValue(s, 1009, baseNurseryHunger)

end

else

if mypb.itemid >= 1 then

doItemSetAttribute(mypb.uid, "hp", 1)

if getItemAttribute(mypb.uid, "hunger") and getItemAttribute(mypb.uid, "hunger") > baseNurseryHunger then

doItemSetAttribute(mypb.uid, "hunger", baseNurseryHunger)

end

if getItemAttribute(mypb.uid, "happy") and getItemAttribute(mypb.uid, "happy") < baseNurseryHappiness then

doItemSetAttribute(mypb.uid, "happy", baseNurseryHappiness)

end

if getPlayerStorageValue(cid, 17000) <= 0 and getPlayerStorageValue(cid, 17001) <= 0 and getPlayerStorageValue(cid, 63215) <= 0 then

doUpdatePokemonsBar(cid)

for a, b in pairs (pokeballs) do

if isInArray(b.all, mypb.itemid) then

doTransformItem(mypb.uid, b.on)

end

end

end

end

end

local bp = getPlayerSlotItem(cid, CONST_SLOT_BACKPACK)

for balls = 1, 8 do

for times = 1, 3 do

local items = getItemsInContainerById(bp.uid, pokeballs[balls].all[times])

if #items >= 1 then

for _, uid in pairs(items) do

doItemSetAttribute(uid, "hp", 1)

doTransformItem(uid, pokeballs[balls].on)

if getItemAttribute(uid, "hunger") and getItemAttribute(uid, "hunger") > baseNurseryHunger then

doItemSetAttribute(uid, "hunger", baseNurseryHunger)

end

if getItemAttribute(uid, "happy") and getItemAttribute(uid, "happy") < baseNurseryHappiness then

doItemSetAttribute(uid, "happy", baseNurseryHappiness)

end

end

end

end

end

selfSay('There you go! You and your pokemons are healthy again.')

end

end

 

 

Revive:

Data/actions/scripts/revive

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

if itemEx.itemid ~= getPlayerSlotItem(cid, 8).itemid then

return doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")

end

if getPlayerStorageValue(cid, 990) >= 1 then

return doPlayerSendTextMessage(cid, 27, "You can\'t use potions in the gym.")

end

if itemEx.itemid == 12422 then -- saffari

doItemSetAttribute(itemEx.uid, "hp", 1)

doTransformItem(itemEx.uid, 12420)

doRemoveItem(item.uid, 1)

doSendMagicEffect(getCreaturePosition(cid), 13)

elseif itemEx.itemid == 11828 then -- normal

doItemSetAttribute(itemEx.uid, "hp", 1)

doTransformItem(itemEx.uid, 11826)

doRemoveItem(item.uid, 1)

doSendMagicEffect(getCreaturePosition(cid), 13)

elseif itemEx.itemid == 11831 then -- ultra

doItemSetAttribute(itemEx.uid, "hp", 1)

doTransformItem(itemEx.uid, 11829)

doRemoveItem(item.uid, 1)

doSendMagicEffect(getCreaturePosition(cid), 13)

elseif itemEx.itemid == 11837 then -- super

doItemSetAttribute(itemEx.uid, "hp", 1)

doTransformItem(itemEx.uid, 11835)

doRemoveItem(item.uid, 1)

doSendMagicEffect(getCreaturePosition(cid), 13)

elseif itemEx.itemid == 11834 then -- great

doItemSetAttribute(itemEx.uid, "hp", 1)

doTransformItem(itemEx.uid, 11832)

doRemoveItem(item.uid, 1)

doSendMagicEffect(getCreaturePosition(cid), 13)

end

end

 

 

UP

Editado por ClackBoom
Link para o comentário
https://xtibia.com/forum/topic/187579-nurse-revive/
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Ae meu colega, esses scripts que voce está pedindo sao muito faceis de achar, mas no entanto vou posta- los aqui pra você:

 

Npc/Scripts e crie um arquivo chamado heal.lua

 

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 sir!')
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!')
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), 12)
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.')
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

 

logo após crie na pasta Data/Npcs o arquivo Nurse.xml. Ponha isso dentro:

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Nurse Joy" script="heal.lua" walkinterval="350000" floorchange="0" speed="0">
<health now="150" max="150"/>
<look type="181" head="91" body="102" legs="83" feet="0"/>
<parameters>
<parameter key="message_greet" value="Welcome to the pokemon center! We can {heal} your pokemons here!"/>
<parameter key="message_farewell" value="Always remember to treat well your pokemons!"/>
<parameter key="message_idletimeout" value="Have a nice day."/>
<parameter key="message_walkaway" value="Good bye young trainer!"/>
</parameters>
</npc>

 

Código:

Copie e cole qualquer arquivo da pasta action/script

Você irá Renomea-lo para revive.lua

 

Dentro dele adicione o seguinte código:

function onUse(cid, item, fromPosition, itemEx, toPosition)
if itemEx.itemid ~= getPlayerSlotItem(cid, 8).itemid then
return doPlayerSendCancel(cid, "You must put your pokeball in the correct place!")
end

if getPlayerStorageValue(cid, 990) >= 1 then
return doPlayerSendTextMessage(cid, 27, "You can\'t use potions in the gym.")
end

if itemEx.itemid == 12422 then -- saffari
  doItemSetAttribute(itemEx.uid, "hp", 1)
  doTransformItem(itemEx.uid, 12420)
  doRemoveItem(item.uid, 1)
  doSendMagicEffect(getCreaturePosition(cid), 13)

elseif itemEx.itemid == 11828 then -- normal
  doItemSetAttribute(itemEx.uid, "hp", 1)
  doTransformItem(itemEx.uid, 11826)
  doRemoveItem(item.uid, 1)
  doSendMagicEffect(getCreaturePosition(cid), 13)

elseif itemEx.itemid == 11831 then -- ultra
  doItemSetAttribute(itemEx.uid, "hp", 1)
  doTransformItem(itemEx.uid, 11829)
  doRemoveItem(item.uid, 1)
  doSendMagicEffect(getCreaturePosition(cid), 13)

elseif itemEx.itemid == 11837 then -- super
  doItemSetAttribute(itemEx.uid, "hp", 1)
  doTransformItem(itemEx.uid, 11835)
  doRemoveItem(item.uid, 1)
  doSendMagicEffect(getCreaturePosition(cid), 13)

elseif itemEx.itemid == 11834 then -- great
  doItemSetAttribute(itemEx.uid, "hp", 1)
  doTransformItem(itemEx.uid, 11832)
  doRemoveItem(item.uid, 1)
  doSendMagicEffect(getCreaturePosition(cid), 13)

end
end

 

Depois abra o arquivo actions.xml, localizado na pasta data/actions

E adicione a seguinte tag:

<action itemid="12344" event="script" value="revive.lua" allowfaruse="1" blockwalls="1"/>

 

 

CREDITS: masquente pelo script da nurse

lucashgas pelo script do revive

Editado por MageKapura
Link para o comentário
https://xtibia.com/forum/topic/187579-nurse-revive/#findComment-1274432
Compartilhar em outros sites

  • 0

Então velho, os scripts que você passou ta a mesma coisa S; eles não curam Status nem o CD do poke D=

 

 

 

 

UP D=

 

 

NGM ai SAbe pelo mor de deus? '-'

 

Pooow, alguem ajuda ai man --'

Editado por ClackBoom
Link para o comentário
https://xtibia.com/forum/topic/187579-nurse-revive/#findComment-1274523
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...