- 15
- Posts
- 7
- Years
- Seen Aug 19, 2017
In my game I want to make a pokemon that don't listen to the player until a certain event. How can I do it? I am having problem in it. If you all can help me then thanks to you.
Last edited by a moderator:
elsif isConst?(species,PBSpecies,:YOURPOKEMONSPECIES) && $game_switches[XXX]
othermoves=[]
for i in 0...4
next if i==choice[1]
othermoves[othermoves.length]=i if @battle.pbCanChooseMove?(@index,i,false)
end
if othermoves.length>0
@battle.pbDisplay(_INTL("{1} is ignoring your orders!",pbThis))
newchoice=othermoves[rand(othermoves.length)]
choice[1]=newchoice
choice[2]=@moves[newchoice]
choice[3]=-1
end
elsif @effects[PBEffects::Encore]>0
if @battle.pbCanShowCommands?(@index) &&
@battle.pbCanChooseMove?(@index,@effects[PBEffects::EncoreIndex],false)
if choice[1]!=@effects[PBEffects::EncoreIndex] # Was Encored mid-round
choice[1]=@effects[PBEffects::EncoreIndex]
choice[2]=@moves[@effects[PBEffects::EncoreIndex]]
choice[3]=-1 # No target chosen
end
PBDebug.log("Using Encored move #{choice[2].name}")
end
def pbObedienceCheck?(choice)
return true if choice[0]!=1
if @battle.pbOwnedByPlayer?(@index) && @battle.internalbattle
badgelevel=10
badgelevel=20 if @battle.pbPlayer.numbadges>=1
badgelevel=30 if @battle.pbPlayer.numbadges>=2
badgelevel=40 if @battle.pbPlayer.numbadges>=3
badgelevel=50 if @battle.pbPlayer.numbadges>=4
badgelevel=60 if @battle.pbPlayer.numbadges>=5
badgelevel=70 if @battle.pbPlayer.numbadges>=6
badgelevel=80 if @battle.pbPlayer.numbadges>=7
badgelevel=100 if @battle.pbPlayer.numbadges>=8
move=choice[2]
disobedient=[COLOR=Red]isConst?(species,PBSpecies,:YOURPOKEMONSPECIES) &&
$game_switches[XXX]
[COLOR=Green]# true if disobedient species and switch XXX is on, otherwise false[/COLOR][/COLOR]
hello I tryied your script but it didn't worked I am jusing the elite battle systemYou mean you want to force a specific pkm disobedience?
You can try this, credits to Themaster for the help.
Code:elsif isConst?(species,PBSpecies,:YOURPOKEMONSPECIES) && $game_switches[XXX] othermoves=[] for i in 0...4 next if i==choice[1] othermoves[othermoves.length]=i if @battle.pbCanChooseMove?(@index,i,false) end if othermoves.length>0 @battle.pbDisplay(_INTL("{1} is ignoring your orders!",pbThis)) newchoice=othermoves[rand(othermoves.length)] choice[1]=newchoice choice[2]=@moves[newchoice] choice[3]=-1 end
Paste it under:
Code:elsif @effects[PBEffects::Encore]>0 if @battle.pbCanShowCommands?(@index) && @battle.pbCanChooseMove?(@index,@effects[PBEffects::EncoreIndex],false) if choice[1]!=@effects[PBEffects::EncoreIndex] # Was Encored mid-round choice[1]=@effects[PBEffects::EncoreIndex] choice[2]=@moves[@effects[PBEffects::EncoreIndex]] choice[3]=-1 # No target chosen end PBDebug.log("Using Encored move #{choice[2].name}") end
Edit YOURPOKEMONSPECIES and XXX.
hello I tryied your script but it didn't worked I am jusing the elite battle system