PrisonElectricChair_MapScriptHeader;trigger count
	db 0
 ;callback count
	db 1
	dbw MAPCALLBACK_TILES, SetPrisonElectricBlocks

SetPrisonElectricBlocks:
	scall PrisonElectricDoor
	return

PrisonElectricDoor:
	checkevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_1
	sif false
		end
	checkevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_2
	sif false
		end
	checkevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_3
	sif false
		end
	changeblock 8, 0, $5b
	end

PrisonElectricDoorSign:
	checkevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_1
	iffalse .print_text
	checkevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_2
	iffalse .print_text
	checkevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_3
	sif false
.print_text
		jumptext .text
	end

.text
	db TX_COMPRESSED, $17, $74, $d9, $b5, $8d, $91, $d8, $28, $34
	db $3c, $ac, $c6, $4e, $66, $07, $98, $32, $58
	db $55, $5a, $4e, $64, $21, $5f

	db $80, $70, $9a, $d3, $a2, $11, $2d, $3b, $78
	db $9e, $a9, $3b, $78, $a2, $91, $98, $81, $93
	db $95, $43, $b9, $d0, $b2, $a4, $79, $a5
	db $a6, $80

PrisonElectricChairFlaaffy:
	faceplayer
	cry FLAAFFY
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_TRAP
	loadwildmon FLAAFFY, 30
	startbattle
	reloadmapafterbattle
	disappear 2
	setevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_3
	jump PrisonElectricDoor

PrisonElectricChairRaichu:
	faceplayer
	cry RAICHU
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_TRAP
	loadwildmon RAICHU, 30
	startbattle
	reloadmapafterbattle
	disappear 3
	setevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_2
	jump PrisonElectricDoor

PrisonElectricChairElectabuzz:
	faceplayer
	cry ELECTABUZZ
	setlasttalked 255
	writecode VAR_BATTLETYPE, BATTLETYPE_TRAP
	loadwildmon ELECTABUZZ, 30
	startbattle
	reloadmapafterbattle
	disappear 4
	setevent EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_1
	jump PrisonElectricDoor
	
PrisonElectricChair_MapEventHeader:: db 0, 0

.Warps
	db 3
	warp_def 14, 19, 3, PRISON_F2
	warp_def 15, 19, 4, PRISON_F2
	warp_def 1, 9, 1, PRISON_CONTAINMENT

.CoordEvents
	db 0

.BGEvents
	db 1
	signpost 1, 9, SIGNPOST_READ, PrisonElectricDoorSign

.ObjectEvents
	db 3
	person_event SPRITE_FLAAFFY, 9, 16, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, PrisonElectricChairFlaaffy, EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_3
	person_event SPRITE_RAICHU, 5, 9, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_RED, PERSONTYPE_SCRIPT, 0, PrisonElectricChairRaichu, EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_2
	person_event SPRITE_ELECTABUZZ, 9, 3, SPRITEMOVEDATA_POKEMON, 0, 0, -1, -1, PAL_OW_YELLOW, PERSONTYPE_SCRIPT, 0, PrisonElectricChairElectabuzz, EVENT_PRISON_ELECTRIC_CHAIR_POKEMON_1

