• Do not use Discord to host any images you post, these links expire quickly! You can learn how to add images to your posts here.
  • Eevee Expo's webhost has been having technical issues since Nov. 20th and you might be unable to connect to our site. Staff are also facing issues connecting, so please send a DM to Cat on-site or through Discord directly for faster service!
Wild Item Drops

Wild Item Drops 1.0

Pokémon Essentials Version
v17.2 ➖
I made a script that allows wild Pokémon to drop their hold items when fainted.
Copy and paste wherever.

Code:
Expand Collapse Copy
class PokeBattle_Battler
	def pbFaint(showMessage=true)
	unless fainted?
	  PBDebug.log("!!!***Can't faint with HP greater than 0")
	  return true
	end
	if @fainted
#	  PBDebug.log("!!!***Can't faint if already fainted")
	  return true
	end
	@battle.scene.pbFainted(self)
	pbInitEffects(false)
	# Reset status
	self.status=0
	self.statusCount=0
	if @pokemon && @battle.internalbattle
	  @pokemon.changeHappiness("faint")
	end
	@pokemon.makeUnmega if self.isMega?
	@pokemon.makeUnprimal if self.isPrimal?
	@fainted=true
	# reset choice
	@battle.choices[@index]=[0,0,nil,-1]
	pbOwnSide.effects[PBEffects::LastRoundFainted]=@battle.turncount
	@battle.pbDisplayPaused(_INTL("{1} fainted!",pbThis)) if showMessage
	if !@opponent && @pokemon.item >0 && showMessage
	  $PokemonBag.pbStoreItem(@pokemon.item,1)
	  itemname=PBItems.getName(@pokemon.item)
	  pocket=pbGetPocket(@pokemon.item)
	  @battle.pbDisplayPaused(_INTL("The wild {1} dropped\n{2} <icon=bagPocket#{pocket}> x 1!",@pokemon.name,itemname,@pokemon.item))
	end
	PBDebug.log("[Pokémon fainted] #{pbThis}")
	return true
  end
end

kORa3xX.png


todo:
- separate hold items with drop items
Credits
N/A
Author
Cilerba
Views
3,865
First release
Last update

Ratings

0.00 star(s) 0 ratings

More resources from Cilerba

Back
Top