Relic Castle

Hi!
I need little help with added script.
I would see "Ghost" in Pokemon Tower without SILPHSCOPE.
Pokemons can't be attacked or catched, this is working.
But I don't see new graphic Ghost and name Ghost. I normaly see Gastly and etc.
"Graphics/Battlers/ghost.png" Already have.


I have script above Main
Code:
def pbLoadGhostBitmap
  bitmapFileName="Graphics/Battlers/ghost.png"
  return AnimatedBitmap.new(bitmapFileName)
end

class PokemonBattlerSprite < RPG::Sprite
  def setGhostBitmap
    @_iconbitmap.dispose if @_iconbitmap
    @_iconbitmap=pbLoadGhostBitmap()
    self.bitmap=@_iconbitmap ? @_iconbitmap.bitmap : nil
    self.color=Color.new(0,0,0,0)
  end
end

class PokeBattle_Pokemon
  def setGhostNoGender
    @genderflag=2
  end
end

GHOSTMAPS=[79,80,81,82,83]

def isGhostEncountersActive?
  onGhostMap=false
  for i in 0...GHOSTMAPS.length
    if $game_map.map_id==GHOSTMAPS[i]
      onGhostMap=true
      break
    end
  end
  return onGhostMap && !$PokemonBag.pbHasItem?(:SILPHSCOPE)
end

In PokeBattle
1. = Working
Code:
    # Changed added
    # Guaranteed escape from ghosts in Pokemon tower
    if isGhostEncountersActive?
      pbDisplayPaused(_INTL("Got away safely!"))
      @decision=3
      return 1
    end
    # Changed end

2. = Working
Code:
# Changed added
    if isGhostEncountersActive? || $game_switches[88] # if your using the changing encounters mid game to add ghosts, then you need to use if $game_switches[170] || $game_switches[169] - switch 169 is the one defined as the switch that changes the encounters
      pbDisplay(_INTL("Can't be catch!"))
      return
    end
    # End changed

3. = Doesn't work
Code:
#========================
# Initialize wild Pokémon
#========================
    if !@opponent
      if @party2.length==1
        if @doublebattle
          raise _INTL("Only two wild Pokémon are allowed in double battles")
        end
        wildpoke=@party2[0]
        wildpoke.name="Ghost" if isGhostEncountersActive? # Changed added this line
        wildpoke.setGhostNoGender if isGhostEncountersActive? # Changed added
       
        @battlers[1].pbInitialize(wildpoke,0,false)
        @peer.pbOnEnteringBattle(self,wildpoke)
       
        # pbSetSeen(wildpoke) # Changed removed this, added below:
        pbSetSeen(wildpoke) if !isGhostEncountersActive?
       
        @scene.pbStartBattle(self)
       
        #pbDisplayPaused(_INTL("Wild {1} appeared!",wildpoke.name))
        # Changed edited from the above
        if isGhostEncountersActive?
          pbDisplayPaused(_INTL("The Ghost appeared!"))
          pbDisplayPaused(_INTL("Darn!\nThe Ghost can't be ID'd!"))
        else
          pbDisplayPaused(_INTL("Wild {1} appeared!",wildpoke.name))
        end
        # Changed done

4. = Working
Code:
# Changed - added - see http://pokemonessentials.wikia.com/wiki/Tutorial:Adding_ghosts
              if isGhostEncountersActive? && !@opponent # In a wild battle
                pbDisplay(_INTL("{1} is too scared to move!",@battlers[i].pbThis))
                commandDone=true
              #if pbCanShowFightMenu?(i)
              # End Changed

In PokeBattle_AI
5. = Working
Code:
# Changed added
      if isGhostEncountersActive? # if you're using the changing encounters mid game to add ghosts, then you need to use if $game_switches[170] || $game_switches[169] - switch 169 is the one defined as the switch that changes the encounters
        pbDisplay(_INTL("Ghost: Get out... Get out..."))        
        return                                                                      
      end
      # Changed end


In Pokemon_Scene
6. = ???
Code:
# Changed added
          if isGhostEncountersActive?
            ghost=@battle.party2[0]
            @sprites["pokemon1"].setGhostBitmap()
          else
            @sprites["pokemon1"].setPokemonBitmap(@battle.party2[0],false)
          end
          # Changed end

I don't see any mistakes. Maybe something missing.
I don't want make Ghost, like create Pokemon named "Ghost". I would fix this point 3.
I am using LukaUtilities and EliteBattle.
Thank you for help!
Top