XX

[Resolvido] Pokémons Selvagem sem sexo

Por xxxttten, 02 de set. de 2018 em Resolvidos

35
5.6k
xxxtttenX
02 de setembro de 2018 às 09:28

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

xxxtttenX
02 de setembro de 2018 às 09:47

Os pokémons do configuration.lua estão entre 500 a 750 e isso acontece no old e no new client.

xxxtttenX
02 de setembro de 2018 às 10:16

Coloquei no 500 estava 750 mais mesmo assim todos os selvagem estão assim.

JG6J
03 de setembro de 2018 às 11:23
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)

 

xxxtttenX
03 de setembro de 2018 às 11:31

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

JG6J
03 de setembro de 2018 às 11:35
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?

xxxtttenX
03 de setembro de 2018 às 11:35

Já estava

JG6J
03 de setembro de 2018 às 11:37

Me manda seu spawn inteiro

xxxtttenX
03 de setembro de 2018 às 11:38
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

 

JG6J
08 de setembro de 2018 às 13:13
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?

xxxtttenX
08 de setembro de 2018 às 13:22

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

JG6J
08 de setembro de 2018 às 13:25
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

xxxtttenX
08 de setembro de 2018 às 19:56

ok vou tenta.

nociamN
08 de setembro de 2018 às 20:35
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 

JG6J
08 de setembro de 2018 às 20:49
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