Ir para conteúdo

[Encerrado] [Pokemon] Dúvidas? - Pda


lucashgas

Posts Recomendados

ZeSy

 

 

 

Pow, se tu me passa oonde tu achou esse script, vai me ajudar muito, na moral x;

REP ++ se tu me passar certim ^^

 

Pow, tbm queria que alguem melhorasse o sistema de colocar nome no poke, queria que só se o poke tivesse boostado +5, segue o script do npc:

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end

function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end

function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end

function onThink() npcHandler:onThink() end

function creatureSayCallback(cid, type, msg)

if(not npcHandler:isFocused(cid)) then

return false

end

if msgcontains(msg:lower(), "job") then

selfSay("Hello ".. getCreatureName(cid) .." . I'm the name rater. Do you wanna change the name of your pokemon?", cid)

talk_state = 1

elseif msgcontains(msg:lower(), "nick") or msgcontains(msg:lower(), "yes") and talk_state == 1 then

selfSay("Ok. But first i need you put the ball that contains the pokemon which you wanna change name in the pokeball slot. Is this in?", cid)

talk_state = 2

elseif msgcontains(msg:lower(), "yes") and talk_state == 2 then

selfSay("So, what will be the nickname?", cid)

talk_state = 3

elseif talk_state == 3 then

nick = tostring(msg)

if #getCreatureSummons(cid) == 0 then

if #nick <= 13 then

if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid >= 1 then

doItemSetAttribute(getPlayerSlotItem(cid, CONST_SLOT_FEET).uid, "nickname", "".. nick .."")

selfSay("So be it. Come back anytime.", cid)

talk_state = 0

else

selfSay("There is no ball on the slot.", cid)

talk_state = 2

end

else

selfSay("Too long nickname. Try again.", cid)

talk_state = 2

end

else

selfSay("I want you put your pokemon back to the ball. Try again.", cid)

talk_state = 2

end

elseif msgcontains(msg:lower(), "summon") then

local x = doSummonCreature("Bulbasaur", getCreaturePos(getNpcId()))

doConvinceCreature(getNpcId(), x)

doChallengeCreature(x, cid)

doMonsterSetTarget(x, cid)

doChallengeCreature(getNpcId(), cid)

doMonsterSetTarget(getCreatureSummons(getNpcId())[1], cid)

selfSay("Take this!", cid)

elseif msgcontains(msg:lower(), "no") and talk_state ~= 3 then

selfSay("Hmmm, ok then. COme back anytime.")

talk_state = 0

end

return true

end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

 

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

@ClackBoom

 

Em

if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid >= 1 then

 

mude para:

if getPlayerSlotItem(cid, CONST_SLOT_FEET).itemid >= 1 and getItemAttribute(getPlayerSlotItem(cid, 8).uid, "boost") >= 5 then

 

e edite o texto que será exibido em:

selfSay("There is no ball on the slot.", cid)

 

para algo do tipo:

selfSay("There is no ball on the slot or your pokemon doesnt have the required boost (+5).", cid)

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

@bizao030188

Cara, te amo mto...

Vey ja me disseram que esse bug tava corrigido, só que tá nas paginas anteriores, eu voltei +/- umas 70 paginas e não encontrei.

Vou postar aqui o login.lua o goback.lua(actions) e o outro goback.lua(creaturescript) para ter certeza q você possa me ajudar ;D

 

login.lua:

 

local config = {

loginMessage = getConfigValue('loginMessage'),

useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))

}

 

local flys = {

["Moltres"] = {229, 2300}, -- moltres

["Articuno"] = {230, 2100}, -- artic

["Zapdos"] = {224, 2600}, -- zapdos

["Mew"] = {232, 2200}, -- 1000

["Mewtwo"] = {233, 2200},-- two

["Dragonite"] = {221, 1300},-- nite

["Dragonair"] = {346, 850},-- nair

["Pidgeot"] = {222, 900}, -- geot

["Fearow"] = {226, 800}, -- fearow

["Aerodactyl"] = {227, 1100}, -- aero

["Charizard"] = {216, 1000}, -- chari

["Porygon"] = {316, 600}, -- porygon

["Shiny Moltres"] = {229, 2300}, -- Shiny moltres

["Shiny Articuno"] = {1018, 2100}, -- Shiny artic

["Shiny Zapdos"] = {1019, 2600}, -- Shiny zapdos

["Shiny Mew"] = {1022, 2200}, -- Shiny 1000

["Shiny Mewtwo"] = {1021, 2200},-- Shiny two

["Shiny Dragonite"] = {1020, 1500},-- Shiny nite

["Shiny Dragonair"] = {348, 1300},-- Shiny nair

["Shiny Pidgeot"] = {996, 900}, -- Shiny geot

["Shiny Fearow"] = {997, 800}, -- Shiny fearow

["Shiny Aerodactyl"] = {1017, 1100}, -- Shiny aero

["Shiny Charizard"] = {995, 1000}, -- Shiny chari

["Shiny Porygon"] = {1016, 600}, -- Shiny porygon

["Porygon2"] = {648, 890}, -- 2

["Skarmory"] = {649, 1000}, -- skarmory

["Crobat"] = {652, 1190}, -- crobat

}

 

 

local rides = {

["Tauros"] = {128, 580}, -- tauros

["Ninetales"] = {129, 800}, -- kyuubi

["Rapidash"] = {130, 800}, -- rapid

["Ponyta"] = {131, 410}, -- ponyta

["Rhyhorn"] = {132, 400}, -- rhyhorn

["Arcanine"] = {12, 900}, -- arcan

["Onix"] = {126, 450}, -- onix

["Venusaur"] = {134, 390}, -- venu

["Dodrio"] = {133, 750}, -- dodrio

["Doduo"] = {135, 420}, -- doduo

["Shiny Tauros"] = {1024, 580}, -- tauros

["Shiny Ninetales"] = {999, 800}, -- kyuubi

["Shiny Rapidash"] = {1005, 800}, -- rapid

["Shiny Ponyta"] = {1004, 410}, -- ponyta

["Shiny Rhyhorn"] = {1023, 400}, -- rhyhorn

["Shiny Arcanine"] = {492, 900}, -- arcan

["Shiny Onix"] = {126, 450}, -- onix

["Shiny Venusaur"] = {494, 390}, -- venu

["Shiny Dodrio"] = {1007, 750}, -- dodrio

["Shiny Doduo"] = {1006, 420}, -- doduo

["Shiny Onix"] = {1008, 555}, -- Soonix

["Crystal Onix"] = {293, 480}, -- cristal onix

["Steelix"] = {646, 750}, -- steelix

["Meganium"] = {685, 720}, -- meganium

["Bayleef"] = {686, 555}, -- bayleef

["Stantler"] = {687, 595}, -- stantler

["Houndoom"] = {647, 820}, -- houndoom

["Piloswine"] = {689, 450}, -- piloswine

["Mareep"] = {688, 400}, -- marip

}

 

local surf = {

["Poliwag"] = {lookType=278, speed = 320},

["Poliwhirl"] = {lookType=137, speed = 480},

["Seaking"] = {lookType=269, speed = 520},

["Dewgong"] = {lookType=183, speed = 700},

["Blastoise"] = {lookType=184, speed = 850},

["Tentacruel"] = {lookType=185, speed = 750},

["Lapras"] = {lookType=186, speed = 960},

["Gyarados"] = {lookType=187, speed = 1050},

["Omastar"] = {lookType=188, speed = 680},

["Kabutops"] = {lookType=189, speed = 840},

["Poliwrath"] = {lookType=190, speed = 680},

["Vaporeon"] = {lookType=191, speed = 800},

["Staryu"] = {lookType=266, speed = 385},

["Starmie"] = {lookType=267, speed = 685},

["Goldeen"] = {lookType=268, speed = 355},

["Seadra"] = {lookType=270, speed = 655},

["Golduck"] = {lookType=271, speed = 760},

["Squirtle"] = {lookType=273, speed = 365},

["Wartortle"] = {lookType=275, speed = 605},

["Tentacool"] = {lookType=277, speed = 340},

["Snorlax"] = {lookType=300, speed = 500},

 

["Shiny Poliwag"] = {lookType=1010, speed = 320},

["Shiny Poliwhirl"] = {lookType=1011, speed = 480},

["Shiny Seaking"] = {lookType=1027, speed = 520},

["Shiny Dewgong"] = {lookType=1015, speed = 700},

["Shiny Blastoise"] = {lookType=1002, speed = 850},

["Shiny Tentacruel"] = {lookType=1014, speed = 750},

["Shiny Lapras"] = {lookType=1031, speed = 960},

["Shiny Gyarados"] = {lookType=1030, speed = 1050},

["Shiny Omastar"] = {lookType=1033, speed = 680},

["Shiny Kabutops"] = {lookType=1034, speed = 840},

["Shiny Poliwrath"] = {lookType=1012, speed = 680},

["Shiny Vaporeon"] = {lookType=1032, speed = 800},

["Shiny Staryu"] = {lookType=1028, speed = 385},

["Shiny Starmie"] = {lookType=1029, speed = 685},

["Shiny Goldeen"] = {lookType=1026, speed = 355},

["Shiny Seadra"] = {lookType=1025, speed = 655},

["Shiny Golduck"] = {lookType=1009, speed = 760},

["Shiny Squirtle"] = {lookType=1000, speed = 365},

["Shiny Wartortle"] = {lookType=1001, speed = 605},

["Shiny Tentacool"] = {lookType=1013, speed = 340},

["Shiny Snorlax"] = {lookType=1035, speed = 500},

 

["Mantine"] = {lookType=636, speed = 820},

["Totodile"] = {lookType=637, speed = 360},

["Croconow"] = {lookType=638, speed = 590},

["Feraligatr"] = {lookType=645, speed = 900},

["Marill"] = {lookType=639, speed = 340},

["Azumarill"] = {lookType=642, speed = 680},

["Quagsire"] = {lookType=643, speed = 740},

["Kingdra"] = {lookType=644, speed = 1020},

["Octillery"] = {lookType=641, speed = 600},

["Wooper"] = {lookType=640, speed = 315},

}

 

function onLogin(cid)

 

if getPlayerStorageValue(cid, 61543) == 1 then -- Bug Saffari

doTeleportThing(cid,{x=1152,y=1407,z=8})

end

 

 

doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, 100)

doCreatureSetDropLoot(cid, false)

 

local accountManager = getPlayerAccountManager(cid)

 

if(accountManager == MANAGER_NONE) then

local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage

if(lastLogin > 0) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."

else

str = str

end

 

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)

 

elseif(accountManager == MANAGER_NAMELOCK) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")

elseif(accountManager == MANAGER_ACCOUNT) then

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")

else

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")

end

 

if getCreatureName(cid) == "Account Manager" then

local outfit = {}

if accountManagerRandomPokemonOutfit then

outfit = {lookType = getPokemonXMLOutfit(oldpokedex[math.random(151)][1])}

else

outfit = accountManagerOutfit

end

 

doSetCreatureOutfit(cid, outfit, -1)

return true

end

 

if(not isPlayerGhost(cid)) then

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)

end

 

local outfit = {}

 

if getPlayerVocation(cid) == 0 then

doPlayerSetMaxCapacity(cid, 0)

doPlayerSetVocation(cid, 1)

setCreatureMaxMana(cid, 6)

doPlayerAddSoul(cid, -getPlayerSoul(cid))

setPlayerStorageValue(cid, 19898, 0)

if getCreatureOutfit(cid).lookType == 128 then

outfit = {lookType = 510, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}

elseif getCreatureOutfit(cid).lookType == 136 then

outfit = {lookType = 511, lookHead = math.random(0, 132), lookBody = math.random(0, 132), lookLegs = math.random(0, 132), lookFeet = math.random(0, 132)}

end

doCreatureChangeOutfit(cid, outfit)

end

 

registerCreatureEvent(cid, "WatchTv")

registerCreatureEvent(cid, "StopWatchingTv")

registerCreatureEvent(cid, "WalkTv")

registerCreatureEvent(cid, "RecordTv")

--registerCreatureEvent(cid, "Death")

registerCreatureEvent(cid, "PlayerLogout")

registerCreatureEvent(cid, "WildAttack")

registerCreatureEvent(cid, "Idle")

registerCreatureEvent(cid, "PokemonIdle")

registerCreatureEvent(cid, "EffectOnAdvance")

registerCreatureEvent(cid, "GeneralConfiguration")

registerCreatureEvent(cid, "ReportBug")

registerCreatureEvent(cid, "LookSystem")

registerCreatureEvent(cid, "T1")

registerCreatureEvent(cid, "T2")

registerCreatureEvent(cid, "StorageLogout")

registerCreatureEvent(cid, "FireTaskCount")

registerCreatureEvent(cid, "EletricTaskCount")

 

if getPlayerStorageValue(cid, 99284) == 1 then

setPlayerStorageValue(cid, 99284, -1)

end

 

doChangeSpeed(cid, -(getCreatureSpeed(cid)))

 

if getPlayerStorageValue(cid, 17000) >= 1 then -- fly

 

local item = getPlayerSlotItem(cid, 8)

local poke = getItemAttribute(item.uid, "poke")

doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

doRemoveCondition(cid, CONDITION_OUTFIT)

doSetCreatureOutfit(cid, {lookType = flys[poke][1] + 351}, -1)

 

local apos = getFlyingMarkedPos(cid)

apos.stackpos = 0

if getTileThingByPos(apos).itemid <= 2 then

doCombatAreaHealth(cid, FIREDAMAGE, getFlyingMarkedPos(cid), 0, 0, 0, CONST_ME_NONE)

doCreateItem(460, 1, getFlyingMarkedPos(cid))

end

 

doTeleportThing(cid, apos, false)

 

elseif getPlayerStorageValue(cid, 63215) >= 1 then -- surf

 

if not isInArray({4820, 4821, 4822, 4823, 4824, 4825}, getTileInfo(getThingPos(cid)).itemid) then

setPlayerStorageValue(cid, 63215, -1)

doChangeSpeed(cid, PlayerSpeed)

doRemoveCondition(cid, CONDITION_OUTFIT)

return true

end

 

local item = getPlayerSlotItem(cid, 8)

local poke = getItemAttribute(item.uid, "poke")

doSetCreatureOutfit(cid, {lookType = surf[poke].lookType + 351}, -1)

doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

 

elseif getPlayerStorageValue(cid, 17001) >= 1 then -- ride

 

local item = getPlayerSlotItem(cid, 8)

local poke = getItemAttribute(item.uid, "poke")

if rides[poke] then

doChangeSpeed(cid, getPlayerStorageValue(cid, 54844))

doRemoveCondition(cid, CONDITION_OUTFIT)

doSetCreatureOutfit(cid, {lookType = rides[poke][1] + 351}, -1)

else

setPlayerStorageValue(cid, 17001, -1)

doChangeSpeed(cid, PlayerSpeed)

end

 

elseif getPlayerStorageValue(cid, 13008) >= 1 then -- dive

if not isInArray({5405, 5406, 5407, 5408, 5409, 5410}, getTileInfo(getThingPos(cid)).itemid) then

setPlayerStorageValue(cid, 13008, 0)

doChangeSpeed(cid, PlayerSpeed)

doRemoveCondition(cid, CONDITION_OUTFIT)

return true

end

if getPlayerSex(cid) == 1 then

doSetCreatureOutfit(cid, {lookType = 1034, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)

else

doSetCreatureOutfit(cid, {lookType = 1035, lookHead = getCreatureOutfit(cid).lookHead, lookBody = getCreatureOutfit(cid).lookBody, lookLegs = getCreatureOutfit(cid).lookLegs, lookFeet = getCreatureOutfit(cid).lookFeet}, -1)

end

doChangeSpeed(cid, 800)

 

elseif getPlayerStorageValue(cid, 5701) > 0 then -- bike

doSendMagicEffect(getThingPos(cid), 177)

setPlayerStorageValue(cid, 5701, 1)

doChangeSpeed(cid, PlayerSpeed * 2)

doRemoveCondition(cid, CONDITION_OUTFIT)

local outfit = getCreatureOutfit(cid)

if getPlayerSex(cid) == 0 then

out = 1393

else

out = 1394

end

doSetCreatureOutfit(cid, {lookType = out, lookHead = outfit.lookHead, lookBody = outfit.lookBody, lookLegs = outfit.lookLegs, lookFeet = outfit.lookFeet}, -1)

return true

 

elseif getPlayerGroupId(cid) >= 4 and getPlayerGroupId(cid) <= 7 then

doChangeSpeed(cid, 140*getPlayerGroupId(cid))

else

doChangeSpeed(cid, PlayerSpeed)

end

 

return true

end

 

 

goback.lua(creaturescript):

 

function onLogout(cid)

 

if getPlayerStorageValue(cid, 61543) == 1 then

doPlayerSendCancel(cid, "You cant logout in Saffari Zone.")

return false

end

 

local thisitem = getPlayerSlotItem(cid, 8)

 

if thisitem.uid <= 0 then return true end

 

local ballName = getItemAttribute(thisitem.uid, "poke")

 

--------------------------------------------------------

btype = getPokeballType(thisitem.itemid)

---------------------------------------------------------------

if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 637501) >= 1 then

BackTeam(cid, getCreatureSummons(cid)) --edited team scyther

end

-------------------------------------------------------------------

local summon = getCreatureSummons(cid)[1]

 

if #getCreatureSummons(cid) == 1 and thisitem.uid > 1 then

doItemSetAttribute(thisitem.uid, "hp", getPlayerStorageValue(cid, 212120) / getPlayerStorageValue(cid, 212121))

doTransformItem(thisitem.uid, pokeballs[btype].on)

 

doSendMagicEffect(getThingPos(summon), pokeballs[btype].effect)

doRemoveCreature(summon)

end

 

if getCreatureOutfit(cid).lookType == 814 then

doPlayerStopWatching(cid)

end

 

if getPlayerStorageValue(cid, 17000) >= 1 then

markFlyingPos(cid, getThingPos(cid))

end

 

return TRUE

end

 

local deathtexts = {"Oh no! POKENAME, come back!", "Come back, POKENAME!", "That's enough, POKENAME!", "You did well, POKENAME!",

"You need to rest, POKENAME!", "Nice job, POKENAME!", "POKENAME, you are too hurt!"}

 

function onDeath(cid, deathList)

 

local owner = getCreatureMaster(cid)

 

local thisball = getPlayerSlotItem(owner, 8)

local ballName = getItemAttribute(thisball.uid, "poke")

 

if getPlayerStorageValue(cid, 212124) >= 1 then

return true

end

 

btype = getPokeballType(thisball.itemid)

 

doSendMagicEffect(getThingPos(cid), pokeballs[btype].effect)

doTransformItem(thisball.uid, pokeballs[btype].off)

 

doPlayerSendTextMessage(owner, 22, "Your pokemon fainted.")

 

local say = deathtexts[math.random(#deathtexts)]

say = string.gsub(say, "POKENAME", getCreatureName(cid))

 

if getPlayerStorageValue(cid, 33) <= 0 then

doCreatureSay(owner, say, TALKTYPE_SAY)

end

 

doItemSetAttribute(thisball.uid, "hp", 0)

doItemSetAttribute(thisball.uid, "happy", getPlayerStorageValue(cid, 1008) - happyLostOnDeath)

doItemSetAttribute(thisball.uid, "hunger", getPlayerStorageValue(cid, 1009))

 

doRemoveCreature(cid)

 

return false

end

 

 

goback.lua(actions):

 

local EFFECTS = {

--[OutfitID] = {Effect}

[427] = 35, --magmar

[1320] = 35, --shiny magmar --edited efeito magmar/jynx

[633] = 55, --jynx

[850] = 55, --shiny jynx

[1318] = 55, --shiny jynx2

}

 

local hitmonchans = {

["Hitmonchan"] = {

[0] = {out = 559, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal

[1] = {out = 1075, eff = 35, type = FIREDAMAGE}, --outfit fogo

[2] = {out = 1077, eff = 48, type = ELECTRICDAMAGE}, --outfit raio

[3] = {out = 1078, eff = 43, type = ICEDAMAGE}, --outfit gelo

[4] = {out = 1076, eff = 140, type = GHOSTDAMAGE} --outfit ghost

},

 

["Shiny Hitmonchan"] = {

[0] = {out = 837, eff = 112, type = FIGHTINGDAMAGE}, --outfit normal

[1] = {out = 1080, eff = 35, type = FIREDAMAGE}, --outfit fogo

[2] = {out = 1081, eff = 48, type = ELECTRICDAMAGE}, --outfit raio

[3] = {out = 1082, eff = 43, type = ICEDAMAGE}, --outfit gelo

[4] = {out = 1079, eff = 140, type = GHOSTDAMAGE} --outfit ghost

}

}

function onUse(cid, item, frompos, item2, topos)

 

if exhaustion.get(cid, 6666) and exhaustion.get(cid, 6666) > 0 then return true end

 

local owner = getItemAttribute(item.uid, "firstpoke")

 

if owner and owner ~= getCreatureName(cid) then

doPlayerSendCancel(cid, "This pokemon belongs to "..owner..", it is his first pokemon. Please, give it back to him.")

return true

end

 

if getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1 or getPlayerStorageValue(cid, 63215) >= 1 then

return true

end

-------------------------------------------------------

ballName = getItemAttribute(item.uid, "poke")

 

btype = getPokeballType(item.itemid)

usando = pokeballs[btype].use

 

local effect = pokeballs[btype].effect

if not effect then

effect = 21

end

----------------------------------------------------------

if item.itemid == usando then

 

if getPlayerStorageValue(cid, 990) == 1 then -- GYM

doPlayerSendCancel(cid, "You can't return your pokemon during gym battles.")

return true

end

 

---------------------------------------------------------------------------------------

if #getCreatureSummons(cid) > 1 and getPlayerStorageValue(cid, 637501) >= 1 then

BackTeam(cid, getCreatureSummons(cid), effect) --<<-- Edited Team Slice system

end

---------------------------------------------------------------------------------------

 

if #getCreatureSummons(cid) <= 0 then

if isInArray(pokeballs[btype].all, item.itemid) then

doTransformItem(item.uid, pokeballs[btype].off)

doItemSetAttribute(item.uid, "hp", 0)

doPlayerSendCancel(cid, "This pokemon is fainted.")

return true

end

end

 

local cd = getCD(item.uid, "blink", 30)

if cd > 0 then

setCD(item.uid, "blink", 0)

end

 

local z = getCreatureSummons(cid)[1]

 

if getCreatureCondition(z, CONDITION_INVISIBLE) and not isGhostPokemon(z) then

return true

end

 

doReturnPokemon(cid, z, item, effect)

 

elseif item.itemid == pokeballs[btype].on then

 

if item.uid ~= getPlayerSlotItem(cid, CONST_SLOT_FEET).uid then

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

return TRUE

end

 

local thishp = getItemAttribute(item.uid, "hp")

 

if thishp <= 0 then

if isInArray(pokeballs[btype].all, item.itemid) then

doTransformItem(item.uid, pokeballs[btype].off)

doItemSetAttribute(item.uid, "hp", 0)

doPlayerSendCancel(cid, "This pokemon is fainted.")

return true

end

end

 

local pokemon = getItemAttribute(item.uid, "poke")

 

if not pokes[pokemon] then

return true

end

 

local x = pokes[pokemon]

local boosts = getItemAttribute(item.uid, "boost") or 0

 

if getPlayerLevel(cid) + pokemonMaxLevelAbovePlayer < getItemAttribute(item.uid, "level") + boosts then

doPlayerSendCancel(cid, "Your pokemon's level is much higher than yours, you can't use him.")

return true

end

 

doSummonMonster(cid, pokemon)

 

local pk = getCreatureSummons(cid)[1]

if not isCreature(pk) then return true end

------------------------passiva hitmonchan------------------------------

if isSummon(pk) then

local nameHIT = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")

local hands = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands")

if nameHIT == "Shiny Hitmonchan" or nameHIT == "Hitmonchan" then

if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "hands") then

doSetCreatureOutfit(pk, {lookType = hitmonchans[nameHIT][hands].out}, -1)

else

doPlayerSendTextMessage(cid, 27, "Contact a GameMaster! Error in passive system! Attribute \"hands\" missing")

end

end

end

-------------------------------------------------------------------------

---------movement magmar, jynx-------------

if EFFECTS[getCreatureOutfit(pk).lookType] then --edited efeito magmar/jynx

markPosEff(pk, getThingPos(pk))

sendMovementEffect(pk, EFFECTS[getCreatureOutfit(pk).lookType], getThingPos(pk))

end

--------------------------------------------------------------------------

 

if getCreatureName(pk) == "Ditto" then

 

local left = getItemAttribute(item.uid, "transLeft")

local name = getItemAttribute(item.uid, "transName")

 

if left and left > 0 then

setPlayerStorageValue(pk, 1010, name)

doSetCreatureOutfit(pk, {lookType = getItemAttribute(item.uid, "transOutfit")}, -1)

addEvent(deTransform, left * 1000, pk, getItemAttribute(item.uid, "transTurn"))

doItemSetAttribute(item.uid, "transBegin", os.clock())

else

setPlayerStorageValue(pk, 1010, "Ditto")

end

end

 

if isGhostPokemon(pk) then doTeleportThing(pk, getPosByDir(getThingPos(cid), math.random(0, 7)), false) end

 

doCreatureSetLookDir(pk, 2)

 

adjustStatus(pk, item.uid, true, false, true)

doAddPokemonInOwnList(cid, pokemon)

 

doTransformItem(item.uid, item.itemid+1)

 

local pokename = getItemAttribute(item.uid, "nick") or getCreatureName(pk)

 

local mgo = gobackmsgs[math.random(1, #gobackmsgs)].go:gsub("doka", pokename)

doCreatureSay(cid, mgo, TALKTYPE_SAY)

 

doSendMagicEffect(getCreaturePosition(pk), effect)

 

else

 

doPlayerSendCancel(cid, "This pokemon is fainted.")

 

end

 

if useKpdoDlls then

doUpdateMoves(cid)

end

return true

end

 

Muito Obrigado cara, qualker coisa só chama hein(se eu puder ajuder né :p)

Link para o comentário
Compartilhar em outros sites

@bizao030188

 

putz, malz man... passei o script errado pow D=, mais amanhã te dou REP + por ajudar vlw

mais ai, se me ajudar de novo te dou 2 REP + ou pra quem me ajudar... thanks, o script certo é :

Nick.lua

 

local focus = 0

local talk_start = 0

local conv = 0

local target = 0

local following = false

local attacking = false

local talkState = {}

local finalname = ""

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, msge)

local msg = string.lower(msge)

local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

 

if focus == cid then

talk_start = os.clock()

end

if (msgcontains(msg, 'hi') and (focus == 0) and (getDistanceToCreature(cid) <= 4)) then

--if not isPremium(cid) then

--selfSay("Hello, "..getCreatureName(cid).."! I'm sorry, but I can only give nicknames to pokemons for premium members!")

--return true

--end

focus = cid

conv = 1

talk_start = os.clock()

selfSay("Hello, "..getCreatureName(cid).."! I can give your pokemon a nickname, would you like it?")

elseif (msgcontains(msg, "no") or msgcontains(msg, "bye")) and focus == cid and conv ~= 3 then

selfSay("No problem then, sir. Come back when you feel like it!")

focus = 0

elseif msgcontains(msg, "yes") and focus == cid and conv == 1 then

if getPlayerSlotItem(cid, 8).uid <= 0 then

selfSay("Sorry, you don't have a pokemon in the main slot!")

focus = 0

return true

end

selfSay("Put your pokemon at the main slot and tell me, what nickname would you like me to give to your pokemon?")

conv = 3

elseif conv == 3 and focus == cid then

local tablee = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "x", "w", "y", "z", ".", ":", "'", '"', "~", "^", "@", "#", "$", "%", "&", "*", "(", ")", "-", "+", "_", "?", ">", "<", "•", ";", "°", "¹", "²", "³", "£", "¢", "¬", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"}

local table = {"'", '"', "!", "ã", "õ", "ç", "´", "`", "á", "à", "ó", "ò", "é", "è", "í", "ì", "ú", "ù", "¹", "²", "³", "£", "¢", "¬", "§", "°", "º", "ª", "•", "|"}

for a = 1, #table do

if string.find(msg, table[a]) then

selfSay("Sorry, the nick has invalid symbols.")

return true

end

end

if string.len(msg) <= 1 or string.len(msg) >= 19 then

selfSay("Sorry, that nick is too long or too short!")

return true

end

local pokename = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke")

 

selfSay("Are you sure that you want to change your's "..pokename.." name to \""..msge.."\"? This is going to cost you 10 hundred dollars.")

conv = 5

finalname = msge

elseif msgcontains(msg, "yes") and focus == cid and conv == 5 then

if getPlayerSlotItem(cid, 8).uid <= 0 then

selfSay("Where is your pokemon?! You have to keep it at the main slot!")

focus = 0

return true

end

if doPlayerRemoveMoney(cid, 100000) == false then

selfSay("You don't have enough money to afford this service, come back later.")

focus = 0

conv = 0

return true

end

local nick = ""..finalname..""

local description = "Contains a "..getItemAttribute(getPlayerSlotItem(cid, 8).uid, "poke").."."

selfSay("Done! Your pokemon now has a new name, enjoy it!")

doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "nick", nick)

local newdes = description.."\nIt's nickname is: "..finalname.."."

doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "description", newdes)

local hp = getItemAttribute(getPlayerSlotItem(cid, 8).uid, "happy")

doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "happy", hp + 25)

if #getCreatureSummons(cid) >= 1 then

adjustStatus(getCreatureSummons(cid)[1], getPlayerSlotItem(cid, 8).uid)

end

focus = 0

conv = 0

end

end

 

local intervalmin = 38

local intervalmax = 70

local delay = 25

local number = 1

local messages = {"Want to give some nicknames to your pokemon? Talk to me!",

"Did you know your pokemon gets a little happier when you give him a nickname?",

"Every pokemon wants to have a nickname! Come talk to me!",

"Pokemons love nicknames, you should give yours one.",

}

function onThink()

if focus == 0 then

selfTurn(1)

delay = delay - 0.5

if delay <= 0 then

selfSay(messages[number])

number = number + 1

if number > #messages then

number = 1

end

delay = math.random(intervalmin, intervalmax)

end

return true

else

if not isCreature(focus) then

focus = 0

return true

end

local npcpos = getThingPos(getThis())

local focpos = getThingPos(focus)

if npcpos.z ~= focpos.z then

focus = 0

return true

end

if (os.clock() - talk_start) > 45 then

focus = 0

selfSay("Come back some other time!")

end

if getDistanceToCreature(focus) > 3 then

selfSay("Enjoy!")

focus = 0

return true

end

local dir = doDirectPos(npcpos, focpos)

selfTurn(dir)

end

 

return true

end

 

 

 

 

Aee :}

Dúvidas:

 

Promote system ( player fala com NPC e ganha uma clan . e ganha 20% a mais no elemento que ele escolheu. e se possivel colocar no Look, ex: You see a Elt. He is a Naturia seed.

-------------------------

NPC de dar nome aos pokes só se o poke tiver +5....

 

REP +

 

Link para o comentário
Compartilhar em outros sites

@ZeSy

 

No goback.lua do creaturescripts procure por essa linha:

 

doItemSetAttribute(thisitem.uid, "hp", getPlayerStorageValue(cid, 212120) / getPlayerStorageValue(cid, 212121))

 

e apague ela. Ve se funciona...

 

@Clack

Embaixo de

if doPlayerRemoveMoney(cid, 100000) == false then
selfSay("You don't have enough money to afford this service, come back later.")
focus = 0
conv = 0
return true
end

 

adicione:

 

if getItemAttribute(getPlayerSlotItem(cid, 8).uid, "boost") == nil or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "boost") < 5 then
selfSay("Lalala sem boost.")
focus = 0
conv = 0
return true
end

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

@Bizao030188

coloquei la no script mais não deu, o NPC não fala nada e no .exe da esse erro:

[19/06/2012 15:31:23] [Error - Npc interface]
[19/06/2012 15:31:23] data/npc/scripts/nick.lua:onCreatureSay
[19/06/2012 15:31:23] Description:
[19/06/2012 15:31:23] data/npc/scripts/nick.lua:106: attempt to compare nil with number
[19/06/2012 15:31:23] stack traceback:
[19/06/2012 15:31:23]  data/npc/scripts/nick.lua:106: in function <data/npc/scripts/nick.lua:31>

 

 

Vlw ;]

 

@ZeSy passa o lugar que vc achou o sistema de promote na moral ;x

Grato.

 

Dúvidas:

Promote system ( player fala com NPC e ganha uma clan . e ganha 20% a mais no elemento que ele escolheu. e se possivel colocar no Look, ex: You see a Elt. He is a Naturia seed.

-------------------------

NPC de dar nome aos pokes só se o poke tiver +5....

REP +

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

@Bizao030188

Hahah agora sim deu :]

vlw amanhã do REP +

 

 

cara, onde tu aprendeu script?

THANKS

 

@Zesy

tu não sabe onde acho o script la? u.u

 

Dúvidas:

Promote system ( player fala com NPC e ganha uma clan . e ganha 20% a mais no elemento que ele escolheu. e se possivel colocar no Look, ex: You see a Elt. He is a Naturia seed.

-------------------------

REP +

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

@ClackBoom

 

Não sei, tá umas paginas atraz ai...

Eu nao peguei pq ela tá incompleto e tals...

 

@bizao030188

Cara nao tem um script q quando o poke nao tem nick, nao aparecesse (No Nick) no nome dele? tentei faze uma coisa aqui mais não consegui... não da pra coloca tipo:

 

 

local poknick = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "nick")

local nick = "('..poknick..') " or ""

 

Daí colocava assim:

 

local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..nick..""..levelinfo.."."

 

Daí eu tiraria os parenteses e trocaria por um espaço, apagando ali > .."".. < daí eu coloquei um espaço no nick ali pra preencher depois, mais isso nao dá... fiquei triste...

 

Se não tiver como tira o (No Nick) dos pokes, pode dexa queto, fica feio assim... mais vc já ganho meu REP+ por isso :D

Vlw aii man...

Link para o comentário
Compartilhar em outros sites

Iae galéra, andei sumido né.

Formatei meu computador para Windows Seven, andei aprendendo umas coisas também sobre servidor.

 

Gostaria de fazer uma pergunta:

Tipo eu tenho o Carro System e o Moto System, como faço pra deixar os dois somente Players VIP poder utilizar?

 

Valendo um REP+

Link para o comentário
Compartilhar em outros sites

@ZeSy

 

Ta no caminho... Tenta fazer assim:

 

local nick = getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "nick") or nil
local string = "You see your "..string.lower(getCreatureName(thing.uid)).." "..levelinfo..".\n"
if nick ~= nil then
string=string.."His nickname is "..getItemAttribute(getPlayerSlotItem(getCreatureMaster(thing.uid), 8).uid, "nick")..""
end

 

Entendeu ?

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

Finalmente consegui arrumar o bug que me assolava quando implementava algum patch...

Agora eu to com uma dúvida besta, mas que anda me confundindo bastante...

O server é atualizado (re-upado, link atualizado) a medida em que os bugs sao removidos? Porque eu andei acompanhando o tópico desde o inicio e o server que possuo já não tem diversos bugs que encontraram no passado '-'

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

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