Ir para conteúdo

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


lucashgas

Posts Recomendados

@lucashgas

 

voce sabe o que está errado no script, eu quero fazer que não pode usar duas poções de uma só vez

 

 

function doHealOverTime(cid, div, turn, effect)

if not isCreature(cid) then return true end

if turn <= 0 then return true end

if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return true end

 

local d = div / 10000

local amount = math.floor(getCreatureMaxHealth(cid) * d)

doCreatureAddHealth(cid, amount)

setPlayerStorageValue(item2.uid, 173, 0)

if math.floor(turn/10) == turn/10 then

doSendMagicEffect(getThingPos(cid), effect)

end

addEvent(doHealOverTime, 100, cid, div, turn - 1, effect)

 

end

 

local potions = {

[12346] = {effect = 12, div = 20},

[12347] = {effect = 13, div = 40},

[12348] = {effect = 13, div = 60},

[12345] = {effect = 14, div = 80},

[12343] = {effect = 12, div = 100}}

 

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

if isPlayer(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isCreature(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

if not isPlayer(getCreatureMaster(item2.uid)) then

return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")

end

if getCreatureHealth(item2.uid) == getCreatureMaxHealth(item2.uid) then

return doPlayerSendCancel(cid, "This pokemon is already at full health.")

end

if getPlayerStorageValue(item2.uid, 173) >= 1 then

return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.")

end

doCreatureSay(cid, ""..getCreatureName(item2.uid)..", take this potion!", TALKTYPE_SAY)

doSendMagicEffect(getThingPos(item2.uid), 172)

setPlayerStorageValue(item2.uid, 173, 1)

doRemoveItem(item.uid, 1)

 

local a = potions[item.itemid]

doHealOverTime(item2.uid, a.div, 100, a.effect)

 

return true

end

 

 

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

@renee e @all

hehe, bug de morre com fly depois de dar logout arrumado... vah em creaturescripts/scripts/login.lua e ache essa parte..

 

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)

 

 

e troque por isso...

 

 

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

elseif getTileThingByPos(apos).itemid >= 90 then

doRemoveCondition(cid, CONDITION_OUTFIT)

setPlayerStorageValue(cid, 17000, 0)

end

 

doTeleportThing(cid, apos, false)

 

local posicao = getTownTemplePosition(getPlayerTown(cid))

markFlyingPos(cid, posicao)

 

 

;p espero ter ajudado...

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

Relatorio:

 

Estava tentando arrumar os sequintes bugs :

 

Fly - Quando o player reloga de fly e em seguida morre, ele volta de fly onde tinha relogado...testei aqui e n consegui arrumar

Solucao que eu imagino = Alguma funcao no script PlayerDeath ou Deathtest....Tentei add no Playerdeath algo parecido com o que ja esta la com o storage do ride mas tentei por com o storage do fly mas n deu certo.

 

Dive outfit - Eu uso sistema de outfit que o player da use no item e ganha a outifit de dive embaixo da agua...porem quando ele esta morrendo ele volta pro cp e continua com a roupa...tentei fazer o mesmo do fly no Playerdeath mas n consegui...alguem pode tentar pra min?

 

Bag xeia - O bug da bag xeia e menos de 6 poke na mao...mas esse eu consegui arrumar com a ajuda do zeref e do slicer :)

entao basta fazer o que o slicer disse ai encima.

 

Outro bug que esta dando,,,,quando vc morre de surf...vc volta pro cp com sua outfit normal...mas o pokemon na ball esta morto...e quando vc morre de ride vc volta para o cp montado no ride ainda :)....

 

 

Bom dos bugs que eu sei sao esses que creio que esta dando ou dara no ot de todos ^^

 

 

 

Edit --- ele arrumo o fly ja..kkkk...sabe como arrumar o do dive?

 

uso isto aqui no login.lua

 

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

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)

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

Não sei se isso tem algo haver... bom no Test Server do servidor do Jefferson (vulgo Jeffe000)... ele botou o coins case como um container, porém Immoble... e você botando pokemóns lá eles não somem quando morre.

Sera que essas bags não tem algo haver com isto no dat?

 

E outra... alguém conseguiria fazer o Boost System funcionar com count ? (Stones Agrupáveis)?

 

E por fim... o método que passaram do fly... (nome blockwalls, creio eu)... Funciona de boa... o problema que isso é "meio" que uma gambiarra... Seria bom se desse mesmo para arrumar isto \o.

 

Arrumando sprites do dat... peraí kk.

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

@BLACKHERT

 

use isso q vai da certo...

 

 

 

function setStorage(cid, storage, valor)

if isCreature(cid) then

setPlayerStorageValue(cid, storage, valor)

end

end

 

function doHealOverTime(cid, div, turn, effect)

if not isCreature(cid) then return true end

if turn <= 0 then return true end

if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return true end

 

local d = div / 10000

local amount = math.floor(getCreatureMaxHealth(cid) * d)

doCreatureAddHealth(cid, amount)

if math.floor(turn/10) == turn/10 then

doSendMagicEffect(getThingPos(cid), effect)

end

addEvent(doHealOverTime, 100, cid, div, turn - 1, effect)

end

 

local potions = {

[12346] = {effect = 12, div = 20},

[12347] = {effect = 13, div = 40},

[12348] = {effect = 13, div = 60},

[12345] = {effect = 14, div = 80},

[12343] = {effect = 12, div = 100}}

 

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

if isPlayer(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isCreature(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isPlayer(getCreatureMaster(item2.uid)) then

return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")

end

 

if getCreatureHealth(item2.uid) == getCreatureMaxHealth(item2.uid) then

return doPlayerSendCancel(cid, "This pokemon is already at full health.")

end

 

if getPlayerStorageValue(item2.uid, 173) >= 1 then

return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.")

end

doCreatureSay(cid, ""..getCreatureName(item2.uid)..", take this potion!", TALKTYPE_SAY)

doSendMagicEffect(getThingPos(item2.uid), 172)

setPlayerStorageValue(item2.uid, 173, 1)

doRemoveItem(item.uid, 1)

 

local a = potions[item.itemid]

doHealOverTime(item2.uid, a.div, 100, a.effect)

addEvent(setStorage, 10000, 173, 0)

 

return true

end

 

 

@jeffe000

em tese eh soh usa o ms principio... o problema ta.. q o player n chega a morre ms... dai usar onDeath ou onPrepareDeath n vai adiantar... vo tenta arruma aki... ja aviso...

 

e alias.. se me lembro bem.. se tu morre de fly, ride, surf teu poke morre tb... ;x ali na minha correçao do fly o poke morre...

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

@Slicer vc conseguiu fazer os shinys no spawn.lua?

o meu deu erro igual vc disse antes as vezes aparece 2 pokes ou as vezes até nao vem pokemon nenhum no respaw aparece q nao encontrou eu tava tentando arrumar por isso nem postei o meu

se tiver como da uma força agradeço

Link para o comentário
Compartilhar em outros sites

@Slicer

 

 

o script funciona, mas uma vez que você usar poção não pode mais ser usado novamente

 

@BLACKHERT

 

use isso q vai da certo...

 

 

 

function setStorage(cid, storage, valor)

if isCreature(cid) then

setPlayerStorageValue(cid, storage, valor)

end

end

 

function doHealOverTime(cid, div, turn, effect)

if not isCreature(cid) then return true end

if turn <= 0 then return true end

if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return true end

 

local d = div / 10000

local amount = math.floor(getCreatureMaxHealth(cid) * d)

doCreatureAddHealth(cid, amount)

if math.floor(turn/10) == turn/10 then

doSendMagicEffect(getThingPos(cid), effect)

end

addEvent(doHealOverTime, 100, cid, div, turn - 1, effect)

end

 

local potions = {

[12346] = {effect = 12, div = 20},

[12347] = {effect = 13, div = 40},

[12348] = {effect = 13, div = 60},

[12345] = {effect = 14, div = 80},

[12343] = {effect = 12, div = 100}}

 

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

if isPlayer(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isCreature(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isPlayer(getCreatureMaster(item2.uid)) then

return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")

end

 

if getCreatureHealth(item2.uid) == getCreatureMaxHealth(item2.uid) then

return doPlayerSendCancel(cid, "This pokemon is already at full health.")

end

 

if getPlayerStorageValue(item2.uid, 173) >= 1 then

return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.")

end

doCreatureSay(cid, ""..getCreatureName(item2.uid)..", take this potion!", TALKTYPE_SAY)

doSendMagicEffect(getThingPos(item2.uid), 172)

setPlayerStorageValue(item2.uid, 173, 1)

doRemoveItem(item.uid, 1)

 

local a = potions[item.itemid]

doHealOverTime(item2.uid, a.div, 100, a.effect)

addEvent(setStorage, 10000, 173, 0)

 

return true

end

 

 

@jeffe000

em tese eh soh usa o ms principio... o problema ta.. q o player n chega a morre ms... dai usar onDeath ou onPrepareDeath n vai adiantar... vo tenta arruma aki... ja aviso...

 

e alias.. se me lembro bem.. se tu morre de fly, ride, surf teu poke morre tb... ;x ali na minha correçao do fly o poke morre...

Link para o comentário
Compartilhar em outros sites

@BLACKHERT

sorry mano esqueci de um detalhe.. tenta esse aki..

actions/scripts/potions.lua

Soh pode usar um potion por vez nos pokes...

 

function setStorage(cid, storage, valor)

if isCreature(cid) then

setPlayerStorageValue(cid, storage, valor)

end

end

 

function doHealOverTime(cid, div, turn, effect)

if not isCreature(cid) then return true end

if turn <= 0 then return true end

if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return true end

 

local d = div / 10000

local amount = math.floor(getCreatureMaxHealth(cid) * d)

doCreatureAddHealth(cid, amount)

if math.floor(turn/10) == turn/10 then

doSendMagicEffect(getThingPos(cid), effect)

end

addEvent(doHealOverTime, 100, cid, div, turn - 1, effect)

end

 

local potions = {

[12346] = {effect = 12, div = 20},

[12347] = {effect = 13, div = 40},

[12348] = {effect = 13, div = 60},

[12345] = {effect = 14, div = 80},

[12343] = {effect = 12, div = 100}}

 

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

if isPlayer(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isCreature(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isPlayer(getCreatureMaster(item2.uid)) then

return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")

end

 

if getCreatureHealth(item2.uid) == getCreatureMaxHealth(item2.uid) then

return doPlayerSendCancel(cid, "This pokemon is already at full health.")

end

 

if getPlayerStorageValue(item2.uid, 173) >= 1 then

return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.")

end

doCreatureSay(cid, ""..getCreatureName(item2.uid)..", take this potion!", TALKTYPE_SAY)

doSendMagicEffect(getThingPos(item2.uid), 172)

setPlayerStorageValue(item2.uid, 173, 1)

doRemoveItem(item.uid, 1)

 

local sid = item2.uid

local a = potions[item.itemid]

doHealOverTime(item2.uid, a.div, 100, a.effect)

addEvent(setStorage, 10000, sid, 173, 0)

 

return true

end

 

 

 

@lastdemon

eu fiz assim... ;p lembrando q ta configurado pra 1% chance vira shiny para pokes normais.. e 0.1% pra pokes raros.. mas dai eh soh modificar como quiser...

creaturescripts/scripts/spawn.lua

Systema pokes virando shiny pelo "onSpawn"...

 

local shinys = {

"Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise",

"Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata",

"Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran Female",

"Nidorina", "Nidoqueen", "Nidoran Male", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales",

"Jigglytuff", "Wigglytuff", "Zubat", "Golbat", "Odish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", "Venomoth",

"Diglett", "Dugtrio", "Mewoth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", "Arcanine",

"Poliwag", "Poliwhirl", "Poliwrath", "Abra", "Kadabra", "Alakazam", "Machop", "Machoke", "Machamp", "Bellsprout",

"Weepinbell", "Victreebel", "Tentacool", "Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", "Rapidash", "Slowpoke",

"Slowbro", "Magnamite", "Magneton", "Farfetch'd", "Doduo", "Dodrio", "Seel", "Dewgong", "Grimer", "Muk", "Shellder",

"Cloyster", "Gastly", "Haunter", "Gengar", "Onix", "Drowzee", "Hypno", "Krabby", "Kingler", "Voltorb", "Electrode",

"Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Lickitung", "Koffing", "Weezing", "Rhyhorn",

"Rhydon", "Chansey", "Tangela", "Kangaskhan", "Horsea", "Seadra", "Goldeen", "Seaking", "Staryu", "Starmie", "Mr. Mime",

"Scyther", "Jynx", "Electabuzz", "Magmar", "Pinsir", "Tauros", "Magikarp", "Gyarados", "Lapras", "Ditto", "Eevee", "Vaporeon",

"Jolteon", "Flareon", "Porygon", "Omanyte", "Omastar", "Kabuto", "Kabutops", "Snorlax", "Dragonair", "Dratini"

}

local raros = {"Articuno", "Zapdos", "Moltreas", "Mew", "Mewtwo", "Dragonite", "Aerodactyl"}

 

local function doPokemonRegisterLevel(cid)

if not isCreature(cid) then return true end

if getWildPokemonLevel(cid) == -1 then

setWildPokemonLevel(cid)

end

end

 

local function doSetRandomGender(cid)

if not isCreature(cid) then return true end

local gender = 0

local name = getCreatureName(cid)

if not newpokedex[name] then return true end

local rate = newpokedex[name].gender

if rate == 0 then

gender = 3

elseif rate == 1000 then

gender = 4

elseif rate == -1 then

gender = 0

elseif math.random(1, 1000) <= rate then

gender = 4

else

gender = 3

end

doCreatureSetSkullType(cid, gender)

end

 

local function doShiny(cid)

if isCreature(cid) then

if isSummon(cid) then return true end

if getPlayerStorageValue(cid, 74469) >= 1 then return true end

if isNpcSummon(cid) then return true end

if isInArray(shinys, getCreatureName(cid)) then

transform = math.random(1, 100) --1% chance

elseif isInArray(raros, getCreatureName(cid)) then

transform = math.random(1, 1000) --0.1% chance

elseif not isInArray(raros, getCreatureName(cid)) and not isInArray(shinys, getCreatureName(cid)) then

return true

end

if transform == 10 then

doSendMagicEffect(getThingPos(cid), 18)

local shi = doCreateMonster("Shiny ".. getCreatureName(cid) .."", getThingPos(cid))

setPlayerStorageValue(shi, 74469, 1)

setPlayerStorageValue(cid, 74469, 1)

doRemoveCreature(cid)

else

setPlayerStorageValue(cid, 74469, 1)

end

else

return true

end

end

 

function onSpawn(cid)

 

registerCreatureEvent(cid, "GeneralConfiguration")

registerCreatureEvent(cid, "DirectionSystem")

registerCreatureEvent(cid, "CastSystem")

 

if isSummon(cid) then

registerCreatureEvent(cid, "SummonDeath")

return true

end

 

registerCreatureEvent(cid, "Experience")

 

addEvent(doPokemonRegisterLevel, 5, cid)

addEvent(doSetRandomGender, 5, cid)

addEvent(doShiny, 10, cid)

 

return true

end

 

 

@jeffe000

ja arrumei fly, surf e teu dive... soh q o RIDE vai da o demo pra arruma.. ;x -lembrando q nas minhas correçoes os pokes ficam mortos.. tirando DIVE neh.. ;p- RIDE vai da o bixo pq n tem como verificar se o player morreu ;x -pelo q intendi o brun123 mexeu em algu na source pra teleportar o player pra town quando ele morre... ;x-

segue teu dive.. depois posto o meu login.lua se eu conseguir arruma todos.. ;x

 

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

local grounds = {5405, 5406, 5407, 5408, 5409, 5410}

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)

 

 

@all

sorry se der algum problema.. eu so meio q lokin e as vezes esqueço de algum pequeno detalhe... ;p

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

@BLACKHERT

sorry mano esqueci de um detalhe.. tenta esse aki..

 

function setStorage(cid, storage, valor)

if isCreature(cid) then

setPlayerStorageValue(cid, storage, valor)

end

end

 

function doHealOverTime(cid, div, turn, effect)

if not isCreature(cid) then return true end

if turn <= 0 then return true end

if getCreatureHealth(cid) == getCreatureMaxHealth(cid) then return true end

 

local d = div / 10000

local amount = math.floor(getCreatureMaxHealth(cid) * d)

doCreatureAddHealth(cid, amount)

if math.floor(turn/10) == turn/10 then

doSendMagicEffect(getThingPos(cid), effect)

end

addEvent(doHealOverTime, 100, cid, div, turn - 1, effect)

end

 

local potions = {

[12346] = {effect = 12, div = 20},

[12347] = {effect = 13, div = 40},

[12348] = {effect = 13, div = 60},

[12345] = {effect = 14, div = 80},

[12343] = {effect = 12, div = 100}}

 

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

if isPlayer(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isCreature(item2.uid) then

return doPlayerSendCancel(cid, "You can only use potions on pokemons!")

end

 

if not isPlayer(getCreatureMaster(item2.uid)) then

return doPlayerSendCancel(cid, "You cant use potions on wild pokemons.")

end

 

if getCreatureHealth(item2.uid) == getCreatureMaxHealth(item2.uid) then

return doPlayerSendCancel(cid, "This pokemon is already at full health.")

end

 

if getPlayerStorageValue(item2.uid, 173) >= 1 then

return doPlayerSendCancel(cid, "This pokemon is already under effects of potions.")

end

doCreatureSay(cid, ""..getCreatureName(item2.uid)..", take this potion!", TALKTYPE_SAY)

doSendMagicEffect(getThingPos(item2.uid), 172)

setPlayerStorageValue(item2.uid, 173, 1)

doRemoveItem(item.uid, 1)

 

local sid = item2.uid

local a = potions[item.itemid]

doHealOverTime(item2.uid, a.div, 100, a.effect)

addEvent(setStorage, 10000, sid, 173, 0)

 

return true

end

 

 

 

@lastdemon

eu fiz assim... ;p lembrando q ta configurado pra 1% chance vira shiny para pokes normais.. e 0.1% pra pokes raros.. mas dai eh soh modificar como quiser...

 

local shinys = {

"Bulbasaur", "Ivysaur", "Venusaur", "Charmander", "Charmeleon", "Charizard", "Squirtle", "Wartortle", "Blastoise",

"Caterpie", "Metapod", "Butterfree", "Weedle", "Kakuna", "Beedrill", "Pidgey", "Pidgeotto", "Pidgeot", "Rattata",

"Raticate", "Spearow", "Fearow", "Ekans", "Arbok", "Pikachu", "Raichu", "Sandshrew", "Sandslash", "Nidoran Female",

"Nidorina", "Nidoqueen", "Nidoran Male", "Nidorino", "Nidoking", "Clefairy", "Clefable", "Vulpix", "Ninetales",

"Jigglytuff", "Wigglytuff", "Zubat", "Golbat", "Odish", "Gloom", "Vileplume", "Paras", "Parasect", "Venonat", "Venomoth",

"Diglett", "Dugtrio", "Mewoth", "Persian", "Psyduck", "Golduck", "Mankey", "Primeape", "Growlithe", "Arcanine",

"Poliwag", "Poliwhirl", "Poliwrath", "Abra", "Kadabra", "Alakazam", "Machop", "Machoke", "Machamp", "Bellsprout",

"Weepinbell", "Victreebel", "Tentacool", "Tentacruel", "Geodude", "Graveler", "Golem", "Ponyta", "Rapidash", "Slowpoke",

"Slowbro", "Magnamite", "Magneton", "Farfetch'd", "Doduo", "Dodrio", "Seel", "Dewgong", "Grimer", "Muk", "Shellder",

"Cloyster", "Gastly", "Haunter", "Gengar", "Onix", "Drowzee", "Hypno", "Krabby", "Kingler", "Voltorb", "Electrode",

"Exeggcute", "Exeggutor", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Lickitung", "Koffing", "Weezing", "Rhyhorn",

"Rhydon", "Chansey", "Tangela", "Kangaskhan", "Horsea", "Seadra", "Goldeen", "Seaking", "Staryu", "Starmie", "Mr. Mime",

"Scyther", "Jynx", "Electabuzz", "Magmar", "Pinsir", "Tauros", "Magikarp", "Gyarados", "Lapras", "Ditto", "Eevee", "Vaporeon",

"Jolteon", "Flareon", "Porygon", "Omanyte", "Omastar", "Kabuto", "Kabutops", "Snorlax", "Dragonair", "Dratini"

}

local raros = {"Articuno", "Zapdos", "Moltreas", "Mew", "Mewtwo", "Dragonite", "Aerodactyl"}

 

local function doPokemonRegisterLevel(cid)

if not isCreature(cid) then return true end

if getWildPokemonLevel(cid) == -1 then

setWildPokemonLevel(cid)

end

end

 

local function doSetRandomGender(cid)

if not isCreature(cid) then return true end

local gender = 0

local name = getCreatureName(cid)

if not newpokedex[name] then return true end

local rate = newpokedex[name].gender

if rate == 0 then

gender = 3

elseif rate == 1000 then

gender = 4

elseif rate == -1 then

gender = 0

elseif math.random(1, 1000) <= rate then

gender = 4

else

gender = 3

end

doCreatureSetSkullType(cid, gender)

end

 

local function doShiny(cid)

if isCreature(cid) then

if isSummon(cid) then return true end

if getPlayerStorageValue(cid, 74469) >= 1 then return true end

if isInArray(shinys, getCreatureName(cid)) then

transform = math.random(1, 100) --1% chance

elseif isInArray(raros, getCreatureName(cid)) then

transform = math.random(1, 1000) --0.1% chance

elseif not isInArray(raros, getCreatureName(cid)) and not isInArray(shinys, getCreatureName(cid)) then

return true

end

if transform == 10 then

doSendMagicEffect(getThingPos(cid), 18)

local shi = doCreateMonster("Shiny ".. getCreatureName(cid) .."", getThingPos(cid))

setPlayerStorageValue(shi, 74469, 1)

setPlayerStorageValue(cid, 74469, 1)

doRemoveCreature(cid)

else

setPlayerStorageValue(cid, 74469, 1)

end

else

return true

end

end

 

function onSpawn(cid)

 

registerCreatureEvent(cid, "GeneralConfiguration")

registerCreatureEvent(cid, "DirectionSystem")

registerCreatureEvent(cid, "CastSystem")

 

if isSummon(cid) then

registerCreatureEvent(cid, "SummonDeath")

return true

end

 

registerCreatureEvent(cid, "Experience")

 

addEvent(doPokemonRegisterLevel, 5, cid)

addEvent(doSetRandomGender, 5, cid)

addEvent(doShiny, 10, cid)

 

return true

end

 

 

@jeffe000

ja arrumei fly, surf e teu dive... soh q o RIDE vai da o demo pra arruma.. ;x -lembrando q nas minhas correçoes os pokes ficam mortos.. tirando DIVE neh.. ;p- RIDE vai da o bixo pq n tem como verificar se o player morreu ;x -pelo q intendi o brun123 mexeu em algu na source pra teleportar o player pra town quando ele morre... ;x-

segue teu dive.. depois posto o meu login.lua se eu conseguir arruma todos.. ;x

 

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

local grounds = {5405, 5406, 5407, 5408, 5409, 5410}

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)

 

 

@all

sorry se der algum problema.. eu so meio q lokin e as vezes esqueço de algum pequeno detalhe... ;p

 

Puts valeu cara...ajudo de mais *---*

 

Quanto ao poke morrer,,,axo q o ride e q ta bugado

mas ele creio q n faz diferença...problema mesmo era so o fly.

 

Vlw mesmo Slicer ^^

 

 

Edit

Esse sistema dos shiny funciona como?Eu to usano o do zeref,,,esse ai seria melhor?

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

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