• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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 :.
71
Posts
14
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.
     
    143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    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 :)
     

    Phye

    The Eternal Night :.
    71
    Posts
    14
    Years
  • 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
     
    143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    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 :)
     

    Phye

    The Eternal Night :.
    71
    Posts
    14
    Years
  • 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.
     
    143
    Posts
    4
    Years
    • Seen Mar 26, 2024
    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