Advertiser Content

mgriffin

Seen 4 Hours Ago
Posted 12 Hours Ago
677 posts
5.4 Years
I've been trying to get this to work, but can't figure out even where to start, I tried looking at where Illusion is in the scripts and it ended up confusing me even more, sorry for bothering you guys, but it looks like I can't figure out a simple starting point...
I think you'd be better off looking at how abilities that sometimes have an invisible effect on stats work, e.g. Defeatist or Slow Start.
Seen August 4th, 2019
Posted July 26th, 2019
35 posts
221 Days
if self.hasWorkingAbility(:ILLUSION) &&
self.effects[PBEffects::Illusion]
speedmult=(speedmult*2.0).round

This is what I have set, I based it around the defeatist ability.
The first line checks if the user has the ability, and I believe the second line will check if the effect is active? I may have to add =true at the end or sumthn. the last line adds the effect. I'm gonna try and test it, but if anything looks odd just let me know.
Hi!

mgriffin

Seen 4 Hours Ago
Posted 12 Hours Ago
677 posts
5.4 Years
if self.hasWorkingAbility(:ILLUSION) &&
self.effects[PBEffects::Illusion]
speedmult=(speedmult*2.0).round

This is what I have set, I based it around the defeatist ability.
The first line checks if the user has the ability, and I believe the second line will check if the effect is active? I may have to add =true at the end or sumthn. the last line adds the effect. I'm gonna try and test it, but if anything looks odd just let me know.
Sounds pretty good to me. For the record you probably mean ==true which is "check that it's true" rather than =true which is "set to true". Although as you might notice, self.effects[PBEffects::Illusion]==true is basically the same as self.effects[PBEffects::Illusion].
Seen August 4th, 2019
Posted July 26th, 2019
35 posts
221 Days
Thank you so much for the help! And to anyone viewing this thread, the best way to test it (I think) is by giving yourself a Zoroark with Illusion (Or a new ability if you make it that way) and with max speed EV's and IV's at Lv. 100. then go against a pokemon with higher base speed with maximum EV's and IV's. Then, Zoroark (Or whatever pokemon you have the ability on) should outspeed with the disguise, but when it's broken, it will no longer outspeed.

Edit: After testing, this does work as intended. If you want to make it an entirely different ability just remember to go through the scripts with illusion (Do Ctrl+Shift+F to look thru entire script) as you will need to add it's effects on other moves, abilities, and AI to the new ability.

Edit 2: Btw I put the script into PokeBattle_Battler. Right under the part that slows the user of Slow Start down (Tho it doesn't have to specifically go there.)
Hi!

mgriffin

Seen 4 Hours Ago
Posted 12 Hours Ago
677 posts
5.4 Years
I was wondering a while ago if is possible that Zoroark copys the moveset of the pok%u00E9mon?
So a bit like Transform, but it wears off after being hit? You could probably make that with a bit of effort, I'd start by trying to understand how Transform works.
Seen 16 Hours Ago
Posted 16 Hours Ago
39 posts
184 Days
Ok, I made it... More or less.

I manage to make the ability to copy the moveset but: it only worked if I delete "self.effects[PBEffects::Illusion]" . So i noticed that i have to define when "self.effects[PBEffects::Illusion]" ends (or starts?) so i made it. I got this:

Spoiler:
if self.hasWorkingAbility(:ILLUSION) && self.effects[PBEffects::Illusion]
choice=lastPokemon
lastpoke=@battle.pbGetLastPokeInTeam(@index)
for i in 0...4
@moves[i]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(choice.moves[i].id))
@moves[i].pp=5
@moves[i].totalpp=5
end
end
if self.effects[PBEffects::Illusion] && self.hasWorkingAbility(:ILLUSION) &&
damage>0 && !target.damagestate.substitute
self.effects[PBEffects::Illusion]=nil
end


BUT the game wants me to define what "damage" is and I have no idea how to do that, the only example inside of my scripts doesn´t works. ALSO I don't really know if i have to define when "self.effects[PBEffects::Illusion]" starts, ends or both.

Any idea of what i have to do? u.u
Seen 16 Hours Ago
Posted 16 Hours Ago
39 posts
184 Days
ALSO I don't really know if i have to define when "self.effects[PBEffects::Illusion]" starts, ends or both.
Maybe if i only use:

Spoiler:
if self.hasWorkingAbility(:ILLUSION) && damage>0 && !target.damagestate.substitute
choice=lastPokemon
lastpoke=@battle.pbGetLastPokeInTeam(@index)
for i in 0...4
@moves[i]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(choice.moves[i].id))
@moves[i].pp=5
@moves[i].totalpp=5
end
end


Maybe with only that i can make it work? But i´m still need to define "damage". :(
Seen 16 Hours Ago
Posted 16 Hours Ago
39 posts
184 Days
Well... I manage this to work and i did this:

Spoiler:
if self.hasWorkingAbility(:ILLUSION)
choice=lastPokemon
lastpoke=@battle.pbGetLastPokeInTeam(@index)
self.effects[PBEffects::Transform]=true
if self.effects[PBEffects::Transform]=true
for i in 0...4
@moves[i]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(choice.moves[i].id))
end
end
if self.effects[PBEffects::Transform]=nil
for i in 0...4
@moves[i]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(self.moves[i].id))
end
end
end


And i found where to put the "damage" so i did this:

Spoiler:
if target.effects[PBEffects::Illusion] && target.hasWorkingAbility(:ILLUSION) &&
damage>0 && !target.damagestate.substitute
PBDebug.log("[Ability triggered] #{target.pbThis}'s Illusion ended")
target.effects[PBEffects::Illusion]=nil
target.effects[PBEffects::Transform]=nil
@battle.scene.pbChangePokemon(target,target.pokemon)
@battle.pbDisplay(_INTL("{1}'s {2} wore off!",target.pbThis,
PBAbilities.getName(target.ability)))
end


So: The ability works but the moves doens't come back to zoroarks moves, he keeps the moves from the transformation after getting hit. I think the problem is here but no so sure :(. Any help´? Pls:

Spoiler:
if self.effects[PBEffects::Transform]=nil
for i in 0...4
@moves[i]=PokeBattle_Move.pbFromPBMove(@battle,PBMove.new(self.moves[i].id))
end


I believe the problem is at the end with "self", i have to put something else, maybe? I don´t know...

Note: I had to use: "effects[PBEffects::Transform]" because if i use "effects[PBEffects::Illusion]" the game crashes saying "wrong class". Maybe the problem is there? But i don't think so

Ty for reading.

mgriffin

Seen 4 Hours Ago
Posted 12 Hours Ago
677 posts
5.4 Years
I believe the problem is at the end with "self", i have to put something else, maybe? I don´t know...
I think the problem is that you changed self.moves[i] so your loop is just setting the moves to what they're already set to. What you need to use is the original moves that the Pokémon knew. Maybe take a look at how the moves get populated when the battler is initialized? IILR there's a self.pokemon object or something like that.
Seen 16 Hours Ago
Posted 16 Hours Ago
39 posts
184 Days
I think the problem is that you changed self.moves[i] so your loop is just setting the moves to what they're already set to. What you need to use is the original moves that the Pokémon knew. Maybe take a look at how the moves get populated when the battler is initialized? IILR there's a self.pokemon object or something like that.
Yeah I thought would be that. But still can't manage to make it work. Keep trying
Advertiser Content