Ir para conteúdo
  • 0

[Resolvido] Pokémons Selvagem sem sexo


xxxttten

Pergunta

Bom dia, eu venho tendo esse problema que os pokémons selvagem estão nascendo sem sexo, quando eu dou por exemplo > /cb metagross , ele vem male ou femea. Mais os selvagem do mapa vem tudo indefinido ( sem sexo ).  

image.png

image.png

Link para o comentário
Compartilhar em outros sites

  • Respostas 34
  • Created
  • Última resposta

Top Posters For This Question

Top Posters For This Question

Posted Images

Posts Recomendados

  • 1

Troca essa parte:

 if getPlayerFreeCap(cid) >= 6 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then  
           item = doCreateItemEx(ballid)
        else
            item = doAddContainerItem(getPlayerSlotItem(cid, 3).uid, ballid, 1) 
        end

 por essa:

                                              --alterado v1.9  \/                  
        if getPlayerFreeCap(cid) <= 1 or not hasSpaceInContainer(getPlayerSlotItem(cid, 3).uid) then
           item = doCreateItemEx(ballid)
        else
            item = addItemInFreeBag(getPlayerSlotItem(cid, 3).uid, ballid, 1) 
        end

 

Link para o comentário
Compartilhar em outros sites

  • 0
Em 02/09/2018 em 09:28, Maiconmafrah disse:

Bom dia, eu venho tendo esse problema que os pokémons selvagem estão nascendo sem sexo, quando eu dou por exemplo > /cb metagross , ele vem male ou femea. Mais os selvagem do mapa vem tudo indefinido ( sem sexo ).  

image.png

image.png

vá na pasta creaturescripts/spawn.lua e veja sem tem algo como isso:

Citar

function onThink(cid)
    if isMonster(cid)then

Se tiver coloque isso em baixo do isMonster:

Citar

    addEvent(doSetRandomGender, 5, cid)

 

Link para o comentário
Compartilhar em outros sites

  • 0

Não tem isso lá > function onThink(cid)

9 minutos atrás, joaopera disse:

vá na pasta creaturescripts/spawn.lua e veja sem tem algo como isso:

Se tiver coloque isso em baixo do isMonster:

 

image.png.458588ddae41cd0c6c58fe4b1bde4f2e.png

Link para o comentário
Compartilhar em outros sites

  • 0
3 minutos atrás, Maiconmafrah disse:

Não tem isso lá > function onThink(cid)

image.png.458588ddae41cd0c6c58fe4b1bde4f2e.png

Vc já adicionou o SetRandomGender ali? ou já tava?

Link para o comentário
Compartilhar em outros sites

  • 0
Spoiler

local shinys = {
"Venusaur", "Charizard", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Zubat", "Golbat", "Paras", "Parasect", 
"Venonat", "Venomoth", "Growlithe", "Arcanine", "Abra", "Alakazam", "Tentacool", "Tentacruel", "Farfetch'd", "Grimer", "Muk", "Gengar", "Onix", "Krabby", 
"Kingler", "Voltorb", "Electrode", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Tangela", "Horsea", "Seadra", "Scyther", "Jynx", "Electabuzz", "Pinsir", 
"Magikarp", "Gyarados", "Snorlax", "Dragonair", "Dratini"}
local raros = {"Dragonite"}                               

local function doSetRandomGender(cid)
    if not isCreature(cid) then return true end
    if isSummon(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 = 1
        elseif math.random(1, 1000) <= rate then
            gender = 4
        else
            gender = 3
        end
        
        if gender == 1 then
    doCreatureSetSkullType(cid, gender)
    end
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 getPlayerStorageValue(cid, 22546) >= 1 then return true end 
   if isNpcSummon(cid) then return true end
   if getPlayerStorageValue(cid, 637500) >= 1 then return true end  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 0.1    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 0.1   --1% chance       
else
   return true
end    
    if math.random(1, 1000) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
      doRemoveCreature(cid)
      local shi = doCreateMonster(name, pos, false)
      setPlayerStorageValue(shi, 74469, 1)      
   else
       setPlayerStorageValue(cid, 74469, 1)
   end                                        --/\
else                                                            
return true
end
end
                                                                
function onSpawn(cid)

    registerCreatureEvent(cid, "Experience")
    registerCreatureEvent(cid, "GeneralConfiguration")
    registerCreatureEvent(cid, "DirectionSystem")
    registerCreatureEvent(cid, "CastSystem")
    
    if isSummon(cid) then
        registerCreatureEvent(cid, "SummonDeath")
    return true
    end
    
    addEvent(doSetRandomGender, 5, cid)
    addEvent(doShiny, 10, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

Link para o comentário
Compartilhar em outros sites

  • 0
Em 03/09/2018 em 11:38, Maiconmafrah disse:
  Mostrar conteúdo oculto

local shinys = {
"Venusaur", "Charizard", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Zubat", "Golbat", "Paras", "Parasect", 
"Venonat", "Venomoth", "Growlithe", "Arcanine", "Abra", "Alakazam", "Tentacool", "Tentacruel", "Farfetch'd", "Grimer", "Muk", "Gengar", "Onix", "Krabby", 
"Kingler", "Voltorb", "Electrode", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Tangela", "Horsea", "Seadra", "Scyther", "Jynx", "Electabuzz", "Pinsir", 
"Magikarp", "Gyarados", "Snorlax", "Dragonair", "Dratini"}
local raros = {"Dragonite"}                               

local function doSetRandomGender(cid)
    if not isCreature(cid) then return true end
    if isSummon(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 = 1
        elseif math.random(1, 1000) <= rate then
            gender = 4
        else
            gender = 3
        end
        
        if gender == 1 then
    doCreatureSetSkullType(cid, gender)
    end
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 getPlayerStorageValue(cid, 22546) >= 1 then return true end 
   if isNpcSummon(cid) then return true end
   if getPlayerStorageValue(cid, 637500) >= 1 then return true end  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 0.1    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 0.1   --1% chance       
else
   return true
end    
    if math.random(1, 1000) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
      doRemoveCreature(cid)
      local shi = doCreateMonster(name, pos, false)
      setPlayerStorageValue(shi, 74469, 1)      
   else
       setPlayerStorageValue(cid, 74469, 1)
   end                                        --/\
else                                                            
return true
end
end
                                                                
function onSpawn(cid)

    registerCreatureEvent(cid, "Experience")
    registerCreatureEvent(cid, "GeneralConfiguration")
    registerCreatureEvent(cid, "DirectionSystem")
    registerCreatureEvent(cid, "CastSystem")
    
    if isSummon(cid) then
        registerCreatureEvent(cid, "SummonDeath")
    return true
    end
    
    addEvent(doSetRandomGender, 5, cid)
    addEvent(doShiny, 10, cid)
    addEvent(adjustWildPoke, 5, cid)

return true
end

 

troca seu spawn.lua por esse \/

local shinys = {
"Venusaur", "Charizard", "Blastoise", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Zubat", "Golbat", "Paras", "Parasect", 
"Venonat", "Venomoth", "Growlithe", "Arcanine", "Abra", "Alakazam", "Tentacool", "Tentacruel", "Farfetch'd", "Grimer", "Muk", "Gengar", "Onix", "Krabby", 
"Kingler", "Voltorb", "Electrode", "Cubone", "Marowak", "Hitmonlee", "Hitmonchan", "Tangela", "Horsea", "Seadra", "Scyther", "Jynx", "Electabuzz", "Pinsir", 
"Magikarp", "Gyarados", "Snorlax", "Dragonair", "Dratini"}
local raros = {"Dragonite"}                               

local function doSetRandomGender(cid)
	if not isCreature(cid) then return true end
	if isSummon(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 = 1
		elseif math.random(1, 1000) <= rate then
			gender = 4
		else
			gender = 3
		end
		
		if gender == 1 then
	doCreatureSetSkullType(cid, gender)
	end
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 getPlayerStorageValue(cid, 22546) >= 1 then return true end 
   if isNpcSummon(cid) then return true end
   if getPlayerStorageValue(cid, 637500) >= 1 then return true end  --alterado v1.9
   
if isInArray(shinys, getCreatureName(cid)) then  --alterado v1.9 \/
   chance = 0.1    --1% chance        
elseif isInArray(raros, getCreatureName(cid)) then   --n coloquem valores menores que 0.1 !!
   chance = 0.1   --1% chance       
else
   return true
end    
    if math.random(1, 1000) <= chance*10 then  
      doSendMagicEffect(getThingPos(cid), 18)               
      local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
      doRemoveCreature(cid)
      local shi = doCreateMonster(name, pos, false)
      setPlayerStorageValue(shi, 74469, 1)      
   else
       setPlayerStorageValue(cid, 74469, 1)
   end                                        --/\
else                                                            
return true
end
end
                                                                
function onSpawn(cid)

    registerCreatureEvent(cid, "Experience")
	registerCreatureEvent(cid, "GeneralConfiguration")
	registerCreatureEvent(cid, "DirectionSystem")
	registerCreatureEvent(cid, "CastSystem")
	
	if isSummon(cid) then
		registerCreatureEvent(cid, "SummonDeath")
	return true
	end
	
	addEvent(doSetRandomGender, 5, cid)
	addEvent(doShiny, 10, cid)
	addEvent(adjustWildPoke, 5, cid)

return true
end

 

conseguiu fazer o poke salvar o sexo certo?

Link para o comentário
Compartilhar em outros sites

  • 0
3 minutos atrás, Maiconmafrah disse:

sim só que quando dou catch nele ele vem com sexo por sorteio.

Eu tava mexendo nisso, mais o corpse só fica com sexo indefinido :(

Vou te passar vai em lib/catch system.lua e procure por:

		local quero_esses = {4,3}
	if rate >= totalChance then
		local status = {}
		      status.gender = quero_esses[math.random(1, #quero_esses)]
		      status.happy = 160

e Troque por:

		
	if rate >= totalChance then
		local status = {}
		      status.gender = getItemAttribute(corpse, "gender")
		      status.happy = 160

tem mais 1 desse /\ q ta mais pra baixo, só q o corpse q fica com genderless e então ele só copia to tentando arrumar um jeito de salvar o gender do poke no corpse porem não to conseguindo

Não manjo nada de .lua foi na gambiarra mesmo kk

Link para o comentário
Compartilhar em outros sites

  • 0
7 horas atrás, joaopera disse:

Eu tava mexendo nisso, mais o corpse só fica com sexo indefinido :(

Vou te passar vai em lib/catch system.lua e procure por:


		local quero_esses = {4,3}
	if rate >= totalChance then
		local status = {}
		      status.gender = quero_esses[math.random(1, #quero_esses)]
		      status.happy = 160

e Troque por:


		
	if rate >= totalChance then
		local status = {}
		      status.gender = getItemAttribute(corpse, "gender")
		      status.happy = 160

tem mais 1 desse /\ q ta mais pra baixo, só q o corpse q fica com genderless e então ele só copia to tentando arrumar um jeito de salvar o gender do poke no corpse porem não to conseguindo

Não manjo nada de .lua foi na gambiarra mesmo kk

ai se tem que ir no onDeath e colocar algo assim

 

   if corpse.itemid ~= 0 then  
     doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))  
   end 

Link para o comentário
Compartilhar em outros sites

  • 0
13 minutos atrás, nociam disse:

ai se tem que ir no onDeath e colocar algo assim

 

   if corpse.itemid ~= 0 then  
     doItemSetAttribute(corpse.uid, "gender", getPokemonGender(cid))  
   end 

Blz vou tentar

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...