• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Scripting Question] Poison Point but making it Toxic Poison instead - v18

Phye

The Eternal Night :.
  • 69
    Posts
    15
    Years
    I'm trying to wrap my head around how I can create a poison point ability but instead of normal poison it causes toxic poison.

    This is the script for Poison Point:
    Code:
    BattleHandlers::TargetAbilityOnHit.add(:POISONPOINT,
      proc { |ability,user,target,move,battle|
        next if !move.pbContactMove?(user)
        next if user.poisoned? || battle.pbRandom(100)>=30
        battle.pbShowAbilitySplash(target)
        if user.pbCanPoison?(target,PokeBattle_SceneConstants::USE_ABILITY_SPLASH) &&
           user.affectedByContactEffect?(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
          msg = nil
          if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
            msg = _INTL("{1}'s {2} poisoned {3}!",target.pbThis,target.abilityName,user.pbThis(true))
          end
          user.pbPoison(target,msg)
        end
        battle.pbHideAbilitySplash(target)
      }
    )

    Ive tried changing around some stuff but I just run into errors. Like adding @toxic=1 and things like that. I dunno how this script works. My scripting knowledge is fairly basic as Im mostly just able to edit things that are... rather basic. xD Any help would be appreciated.
     
    To change normal poisoning to its toxic version, suplement the function with the bold part:
    Code:
    pbPoison(user,nil,[B]true[/B])
    (true stands for toxic| false for normal poisoning |false is the default value)
    Hope that helps :)
     
    Sorry doesn't work. And If you missed it this is for v18 of Essentials.

    Code:
    user.pbPoison(target,msg)

    And even if I add a true or what not to this function code. Nothing changes either. I'm still lost in trying to make a toxic poison on contact ability. xD
     
    Sorry doesn't work. And If you missed it this is for v18 of Essentials.

    user.pbPoison(target,msg)
    And even if I add a true or what not to this function code. Nothing changes either. I'm still lost in trying to make a toxic poison on contact ability. xD
    Code:
    def pbPoison(user=nil,msg=nil,toxic=false)
        pbInflictStatus(PBStatuses::POISON,(toxic) ? 1 : 0,msg,user)
      end
    If you enter the Script Section "Battler_Statuses" in V18 around line 335 you'll find this function. Of course you're right that you can't just use
    "pbPoison(user,nil,true)" to poison a target. This function is part of the "PokeBattle_Battler" class which means it can only be associated with an object instance of that class(In this case "user") => using the function should look something like this: target.pbPoison(user,"hi",true).This version would badly poison the target and calculate it as if the user induced the status, while displaying the message "hi". If you still can't get it to work I just could send you the finished ability. I'm sorry if this sounded aggressive, I'm happy to help :)
     
    When I changed pbPoison into target.pbPoison(user,"hi,true)... then the ability wouldnt even work at all xD No Ability pops no nothing. (I know that since during testing the ability I have it as a 100% occurance rate.)
    Code:
    BattleHandlers::TargetAbilityOnHit.add(:TOXICGAS,
      proc { |ability,user,target,move,battle|
        next if !move.pbContactMove?(user)
        next if user.poisoned? || battle.pbRandom(100)>=100
        battle.pbShowAbilitySplash(target)
        if user.pbCanPoison?(target,PokeBattle_SceneConstants::USE_ABILITY_SPLASH) &&
           user.affectedByContactEffect?(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
          msg = nil
          if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
            msg = _INTL("{1}'s {2} badly poisoned {3}!",target.pbThis,target.abilityName,user.pbThis(true))
          end
          target.pbPoison(user,"hi",true)
        end
        battle.pbHideAbilitySplash(target)
      }
    )
    Sorry, I just thought changing something to badly poison wouldn't be this hard xD I mean a contact ability with sleep was easier to deal with.
     
    Code:
    BattleHandlers::TargetAbilityOnHit.add(:TOXICGAS,
      proc { |ability,user,target,move,battle|
        next if !move.pbContactMove?(user)
        next if user.poisoned? || battle.pbRandom(100)>=100
        battle.pbShowAbilitySplash(target)
        if user.pbCanPoison?(target,PokeBattle_SceneConstants::USE_ABILITY_SPLASH) &&
           user.affectedByContactEffect?(PokeBattle_SceneConstants::USE_ABILITY_SPLASH)
          msg = nil
          if !PokeBattle_SceneConstants::USE_ABILITY_SPLASH
            msg = _INTL("{1}'s {2} badly poisoned {3}!",target.pbThis,target.abilityName,user.pbThis(true))
          end
          user.pbPoison(target,nil,true)
        end
        battle.pbHideAbilitySplash(target)
      }
    )
    Try out this code it worked for me so I'm pretty sure it'll work for you as well. :)
     
    Back
    Top