WolfPP

Discord: Wolf#1235

Male
Brazil
Online now
Posted 4 Hours Ago
1,061 posts
1.5 Years
I do to Neuroforce (Ultra Necrozma):
Spoiler:

in 'PokeBattle_Move' search
if attacker.hasWorkingItem(:LIFEORB) && (options&SELFCONFUSE)==0
Below, add:
    if attacker.hasWorkingAbility(:NEUROFORCE) && 
       opponent.damagestate.typemod>8 
      finaldamagemult=(finaldamagemult*1.25).round
    end


To Prism Armor (Necrozma/Dusk Mane Necrozma/Dawn Wings Necrozma)
Spoiler:

in 'PokeBattle_AI' search to:
    # Sniper - n/a
    # Solid Rock, Filter
    if skill>=PBTrainerAI.bestSkill
      if (opponent.hasWorkingAbility(:SOLIDROCK)
and REPLACE to:
    # Sniper - n/a
    # Solid Rock, Filter
    if skill>=PBTrainerAI.bestSkill
      if (opponent.hasWorkingAbility(:SOLIDROCK) || opponent.hasWorkingAbility(:PRISMARMOR) || opponent.hasWorkingAbility(:FILTER)) &&
         typemod>8
        damage=(damage*0.75).round
      end
    end
in 'PokeBattle_Move', search:
      if (opponent.hasWorkingAbility(:SOLIDROCK) ||
         opponent.hasWorkingAbility(:FILTER)) &&
         opponent.damagestate.typemod>8
        finaldamagemult=(finaldamagemult*0.75).round
      end
and REPLACE to:
      if (opponent.hasWorkingAbility(:SOLIDROCK) ||
         opponent.hasWorkingAbility(:PRISMARMOR) ||
         opponent.hasWorkingAbility(:FILTER)) &&
         opponent.damagestate.typemod>8
        finaldamagemult=(finaldamagemult*0.75).round
      end


To put N-Lunarizer and N-Solarizer:
Spoiler:

in 'PItem_ItemEffects' search:
ItemHandlers::UseOnPokemon.add(:DNASPLICERS,proc{|item,pokemon,scene|
   if isConst?(pokemon.species,PBSpecies,:KYUREM)
     if pokemon.hp>0
       if pokemon.fused!=nil
         if $Trainer.party.length>=6
           scene.pbDisplay(_INTL("You have no room to separate the Pok�mon."))
           next false
         else
           #scene.pbAnimForme(pokemon.species,chose,pokemon.form)#
           $Trainer.party[$Trainer.party.length]=pokemon.fused
           pokemon.fused=nil
           pokemon.form=0
           scene.pbHardRefresh
           scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
           next true
         end
       else
         chosen=scene.pbChoosePokemon(_INTL("Fuse with which Pok�mon?"))
         if chosen>=0
           poke2=$Trainer.party[chosen]
           if (isConst?(poke2.species,PBSpecies,:RESHIRAM) ||
              isConst?(poke2.species,PBSpecies,:ZEKROM)) && poke2.hp>0 && !poke2.egg?
             #scene.pbAnimFormeFusion(pokemon.species,chose,poke2.species,chosen,newform)#
             pokemon.form=1 if isConst?(poke2.species,PBSpecies,:RESHIRAM)
             pokemon.form=2 if isConst?(poke2.species,PBSpecies,:ZEKROM)
             pokemon.fused=poke2
             pbRemovePokemonAt(chosen)
             scene.pbHardRefresh
             scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
             next true
           elsif poke2.egg?
             scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
           elsif poke2.hp<=0
             scene.pbDisplay(_INTL("It cannot be fused with that fainted Pok�mon."))
           elsif pokemon==poke2
             scene.pbDisplay(_INTL("It cannot be fused with itself."))
           else
             scene.pbDisplay(_INTL("It cannot be fused with that Pok�mon."))
           end
         else
           next false
         end
       end
     else
       scene.pbDisplay(_INTL("This can't be used on the fainted Pok�mon."))
     end
   else
     scene.pbDisplay(_INTL("It had no effect."))
     next false
   end
})
Bellow that, add:
ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc{|item,pokemon,scene|
   if isConst?(pokemon.species,PBSpecies,:NECROZMA)
     if pokemon.hp>0
       if pokemon.fused!=nil
         if $Trainer.party.length>=6
           scene.pbDisplay(_INTL("You have no room to separate the Pok�mon."))
           next false
         else
           #scene.pbAnimForme(pokemon.species,chose,pokemon.form)#
           $Trainer.party[$Trainer.party.length]=pokemon.fused
           pokemon.fused=nil
           pokemon.form=0
           scene.pbHardRefresh
           scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
           next true
         end
       else
         chosen=scene.pbChoosePokemon(_INTL("Fuse with which Pok�mon?"))
         if chosen>=0
           poke2=$Trainer.party[chosen]
           if isConst?(poke2.species,PBSpecies,:SOLGALEO) && poke2.hp>0 && !poke2.egg?
             #scene.pbAnimFormeFusion(pokemon.species,chose,poke2.species,chosen,newform)#
             pokemon.form=1 if isConst?(poke2.species,PBSpecies,:SOLGALEO)
             pokemon.fused=poke2
             pbRemovePokemonAt(chosen)
             scene.pbHardRefresh
             scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
             next true
           elsif poke2.egg?
             scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
           elsif poke2.hp<=0
             scene.pbDisplay(_INTL("It cannot be fused with that fainted Pok�mon."))
           elsif pokemon==poke2
             scene.pbDisplay(_INTL("It cannot be fused with itself."))
           else
             scene.pbDisplay(_INTL("It cannot be fused with that Pok�mon."))
           end
         else
           next false
         end
       end
     else
       scene.pbDisplay(_INTL("This can't be used on the fainted Pok�mon."))
     end
   else
     scene.pbDisplay(_INTL("It had no effect."))
     next false
   end
})

ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc{|item,pokemon,scene|
   if isConst?(pokemon.species,PBSpecies,:NECROZMA)
     if pokemon.hp>0
       if pokemon.fused!=nil
         if $Trainer.party.length>=6
           scene.pbDisplay(_INTL("You have no room to separate the Pok�mon."))
           next false
         else
           #scene.pbAnimForme(pokemon.species,chose,pokemon.form)#
           $Trainer.party[$Trainer.party.length]=pokemon.fused
           pokemon.fused=nil
           pokemon.form=0
           scene.pbHardRefresh
           scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
           next true
         end
       else
         chosen=scene.pbChoosePokemon(_INTL("Fuse with which Pok�mon?"))
         if chosen>=0
           poke2=$Trainer.party[chosen]
           if isConst?(poke2.species,PBSpecies,:LUNALA) && poke2.hp>0 && !poke2.egg?
             #scene.pbAnimFormeFusion(pokemon.species,chose,poke2.species,chosen,newform)#
             pokemon.form=2 if isConst?(poke2.species,PBSpecies,:LUNALA)
             pokemon.fused=poke2
             pbRemovePokemonAt(chosen)
             scene.pbHardRefresh
             scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
             next true
           elsif poke2.egg?
             scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
           elsif poke2.hp<=0
             scene.pbDisplay(_INTL("It cannot be fused with that fainted Pok�mon."))
           elsif pokemon==poke2
             scene.pbDisplay(_INTL("It cannot be fused with itself."))
           else
             scene.pbDisplay(_INTL("It cannot be fused with that Pok�mon."))
           end
         else
           next false
         end
       end
     else
       scene.pbDisplay(_INTL("This can't be used on the fainted Pok�mon."))
     end
   else
     scene.pbDisplay(_INTL("It had no effect."))
     next false
   end
})
in item.txt (PBS folder), add in the last line:
xxx,ULTRANECROZIUMZ,Ultranecrozium Z, Ultranecrozium Z,1,0,"It's a crystal that turns Necrozma fused with Solgaleo or Lunala into a new form.",0,0,0,
xxx,NSOLARIZER,N-Solarizer,N-Solarizers,8,0,"A machine to fuse and separate Necrozma; needs light, and Solgaleo.",5,0,6,
xxx,NLUNARIZER,N-Lunarizer,N-Lunarizers,8,0,"A machine to fuse and separate Necrozma; needs light, and Lunala.",5,0,6,
xxx= last item number in your item.txt

Then, downloadd that icon into your Icon Folder (Graphic/Icon) and change the number to the same number in item.txt.


NEW SCRIPT TO N-LUNARIZER AND N-SOLARIZER (thanks mybusiness to see the problem):
(Now when you have to separate Necrozma, you can use only N-Solarizer, to Solgaleo, and only N-Lunarizer to Lunala).
Spoiler:

ItemHandlers::UseOnPokemon.add(:NSOLARIZER,proc{|item,pokemon,scene|
   if isConst?(pokemon.species,PBSpecies,:NECROZMA) 
     if pokemon.hp>0 
       if pokemon.fused!=nil
         if $Trainer.party.length>=6
           scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
           next false
         else
          #scene.pbAnimForme(pokemon.species,chose,pokemon.form)#
           $Trainer.party[$Trainer.party.length]=pokemon.fused
           if pokemon.fused!=2#
             scene.pbDisplay(_INTL("It had no effect."))#
             next false#
           else#
             pokemon.fused=nil
             pokemon.form=0
             scene.pbHardRefresh
             scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
             next true
           end#
         end
       else
         chosen=scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
         if chosen>=0
           poke2=$Trainer.party[chosen]
           if isConst?(poke2.species,PBSpecies,:SOLGALEO) && poke2.hp>0 && !poke2.egg? && poke2.form>=0
             #scene.pbAnimFormeFusion(pokemon.species,chose,poke2.species,chosen,newform)#
             pokemon.form=1 if isConst?(poke2.species,PBSpecies,:SOLGALEO)
             pokemon.fused=poke2
             pbRemovePokemonAt(chosen)
             scene.pbHardRefresh
             scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
             next true
           elsif poke2.egg?
             scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
           elsif poke2.hp<=0
             scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
           elsif pokemon==poke2
             scene.pbDisplay(_INTL("It cannot be fused with itself."))
           else
             scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
           end
         else
           next false
         end
       end
     else
       scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
     end
   else
     scene.pbDisplay(_INTL("It had no effect."))
     next false
   end
})

ItemHandlers::UseOnPokemon.add(:NLUNARIZER,proc{|item,pokemon,scene|
   if isConst?(pokemon.species,PBSpecies,:NECROZMA) 
     if pokemon.hp>0 
       if pokemon.fused!=nil
         if $Trainer.party.length>=6
           scene.pbDisplay(_INTL("You have no room to separate the Pokémon."))
           next false
         else
          #scene.pbAnimForme(pokemon.species,chose,pokemon.form)#
           $Trainer.party[$Trainer.party.length]=pokemon.fused
           if pokemon.fused!=1#
             scene.pbDisplay(_INTL("It had no effect."))#
             next false#
           else#
             pokemon.fused=nil
             pokemon.form=0
             scene.pbHardRefresh
             scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
             next true
           end#
         end
       else
         chosen=scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
         if chosen>=0
           poke2=$Trainer.party[chosen]
           if isConst?(poke2.species,PBSpecies,:LUNALA) && poke2.hp>0 && !poke2.egg? && poke2.form>=0
             #scene.pbAnimFormeFusion(pokemon.species,chose,poke2.species,chosen,newform)#
             pokemon.form=2 if isConst?(poke2.species,PBSpecies,:LUNALA)
             pokemon.fused=poke2
             pbRemovePokemonAt(chosen)
             scene.pbHardRefresh
             scene.pbDisplay(_INTL("{1} changed Forme!",pokemon.name))
             next true
           elsif poke2.egg?
             scene.pbDisplay(_INTL("It cannot be fused with an Egg."))
           elsif poke2.hp<=0
             scene.pbDisplay(_INTL("It cannot be fused with that fainted Pokémon."))
           elsif pokemon==poke2
             scene.pbDisplay(_INTL("It cannot be fused with itself."))
           else
             scene.pbDisplay(_INTL("It cannot be fused with that Pokémon."))
           end
         else
           next false
         end
       end
     else
       scene.pbDisplay(_INTL("This can't be used on the fainted Pokémon."))
     end
   else
     scene.pbDisplay(_INTL("It had no effect."))
     next false
   end
})


So, i edited a little BlackOutG5 scritps to Soul Heart (credit to him):
Spoiler:

in 'PokeBattle_Battler' search to 'Moxie' Ability:
    # Moxie
    if user.hasWorkingAbility(:MOXIE) && target.fainted?
      if user.pbIncreaseStatWithCause(PBStats::ATTACK,1,user,PBAbilities.getName(user.ability))
        PBDebug.log("[Ability triggered] #{user.pbThis}'s Moxie")
      end
    end
And below add:
    # Soul Heart
    if user.hasWorkingAbility(:SOULHEART) && target.fainted? && pbPartner.isFainted?
      user=self
      if !user.pbTooHigh?(PBStats::SPATK)
        @battle.pbDisplayEffect(self)
        user.pbIncreaseStatBasic(PBStats::SPATK,1)
        @battle.pbCommonAnimation("StatUp",user,nil)
        if EFFECTMESSAGES
          @battle.pbDisplay(_INTL("{1}'s Special Attack rose!",user.pbThis(true)))
        else
          @battle.pbDisplay(_INTL("{1}'s Soul Heart raised its Special Attack!",user.pbThis))
        end
      #if user.pbIncreaseStatWithCause(PBStats::SPATK,1,user,PBAbilities.getName(user.ability))
          #PBDebug.log("[Ability triggered] #{user.pbThis}'s Soul Heart.")
      end
    end
If you use EBS, add this in 'if EFFECTMESSAGES' , in def 'def pbAbilitiesOnSwitchIn(*args)', add':SOULHEART' in the list on 'if self.'. Something like this:
if EFFECTMESSAGES

class PokeBattle_Battler
  alias pbAbilitiesOnSwitchIn_ebs pbAbilitiesOnSwitchIn unless self.method_defined?(:pbAbilitiesOnSwitchIn_ebs)
  def pbAbilitiesOnSwitchIn(*args)
    if self.checkForAbilities(:FRISK,:FOREWARN,:BADDREAMS,:MOODY,:HARVEST,:TRACE,:INTIMIDATE,:SOULHEART)
      @battle.abilityTrick = self
    else
      @battle.abilityMessage = self
    end
    ret = pbAbilitiesOnSwitchIn_ebs(*args)
    @battle.abilityTrick = nil
    @battle.abilityMessage = nil
    return ret    
  end


EDIT
When Necrozma fused:

in 'Pokemon_Forms' before 'MultipleForms.register(:GIRATINA,{' add:

Spoiler:

MultipleForms.register(:NECROZMA,{
"onSetForm"=>proc{|pokemon,form|
   moves=[
      :SUNSTEELSTRIKE, #Solgaleo is pokemon.form=1
      :MOONGEISTBEAM #Lunala is pokemon.form=2
   ]
   hasoldmove=-1
   for i in 0...4
     for j in 0...moves.length
       if isConst?(pokemon.moves[i].id,PBMoves,moves[j])
         hasoldmove=i; break
       end
     end
     break if hasoldmove>=0
   end
   if form>0
     newmove = moves[form-1]
     if newmove!=nil && hasConst?(PBMoves,newmove)
       if hasoldmove>=0
         # Automatically replace the old form's special move with the new one's
         oldmovename = PBMoves.getName(pokemon.moves[hasoldmove].id)
         newmovename = PBMoves.getName(getID(PBMoves,newmove))
         pokemon.moves[hasoldmove] = PBMove.new(getID(PBMoves,newmove))
         Kernel.pbMessage(_INTL("1,\\wt[16] 2, and\\wt[16]...\\wt[16] ...\\wt[16] ... Ta-da!\\se[Battle ball drop]\1"))
         Kernel.pbMessage(_INTL("{1} forgot how to use {2}.\\nAnd...\1",pokemon.name,oldmovename))
         Kernel.pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]",pokemon.name,newmovename))
       else
         # Try to learn the new form's special move
         pbLearnMove(pokemon,getID(PBMoves,newmove),true)
       end
     end
   else
     if hasoldmove>=0
       # Forget the old form's special move
       oldmovename=PBMoves.getName(pokemon.moves[hasoldmove].id)
       pokemon.pbDeleteMoveAtIndex(hasoldmove)
       Kernel.pbMessage(_INTL("{1} forgot {2}...\\nAnd...\1",pokemon.name,oldmovename))
       pbLearnMove(pokemon,getID(PBMoves,:CONFUSION))
     end
   end
}
})


NEW SCRIPT TO Pokemon_Form:
Also, to 'Pokemon_Form', replace what i wrote in 'onSetForm':
Spoiler:

Spoiler:

"onSetForm"=>proc{|pokemon,form|
   pbSeenForm(pokemon)
      moves=[
      :CONFUSION,       # Normal
      :SUNSTEELSTRIKE,  # Dusk Mane
      :MOONGEISTBEAM,   # Dawn Wings
   ]
   if form!=3
     moves.each{|move|
        pbDeleteMoveByID(pokemon,getID(PBMoves,move))
     }
     pokemon.pbLearnMove(moves[form])
   end
}
})

Then, in 'PSystem_PokemonUtilities' add above 'def pbCheckMove(move)':
Spoiler:

# Deletes the given move from the given Pokémon.
# DEPRECATED - Use pokemon.pbDeleteMove(move) instead
def pbDeleteMoveByID(pokemon,id)
  return if !id || id==0 || !pokemon
  newmoves=[]
  for i in 0...4
    newmoves.push(pokemon.moves[i]) if pokemon.moves[i].id!=id
  end
  newmoves.push(PBMove.new(0))
  for i in 0...4
    pokemon.moves[i]=newmoves[i]
  end
end