Consider the standard gambler's ruin problem: you stark with $K$ chips, and in each round of the game, you increase your chip by one with probability $p$ or decrease by one with probability $q=(1-p)$. I know how to calculate the probability of eventually losing (reaching zero chips) or winning (reaching $N$ chips).
Now consider modifying the game with a third outcome: you increase your chip by one with prob. $p$, decrease with prob. $q$, and a third event $E$ happens with probability $r=(1-p-q)$ at each round, and game ends after the event is triggered.
My question: suppose you start with $K$ chips. What's the probability of winning, losing, and triggering event $E$ before either winning or losing?