Oops, I forgot to change the spell to skill.
CODE
#==============================================================================
# ** VX: Night_Runner's Poisoned Tiles Script.
#------------------------------------------------------------------------------
# History:
# Date Created: 6/Dec/2011
# Created for: RedMonkey
# @> http://www.rpgrevolution.com/forums/index.php?showtopic=54253
#
# Description:
# This script deals damage to players when they step on a poisoned tile.
# If an actor has a state active that counters the poison though they will
# not be damaged.
#
# How to Install:
# Copy this entire script. In your game's editor, select Tools >>
# Script Editor. Along the left hand side scroll all the way to the
# bottom, right click on the square after ( Insert here ), and select
# "Insert". Paste the code on the right.
#
#==============================================================================
#==============================================================================
# ** Customisation
#==============================================================================
module NR_PoisonedTiles
Tile_ID = 0
Damage_On_Poison = 1
Counter_State_ID = 1
Remove_State_After_Use = true
Flash_Screen = true
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# Edited to deal damage on poisoned tiles
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias nr_poisonedTiles_on_player_walk on_player_walk unless $@
#--------------------------------------------------------------------------
# * Processing Performed When Player Takes 1 Step
#--------------------------------------------------------------------------
def on_player_walk(*args)
# Run the original on_player_walk
nr_poisonedTiles_on_player_walk(*args)
# If the player is stepping on tile 195
if $game_player.tile_id == NR_PoisonedTiles::Tile_ID
# Loop through each player
for actor in members
# If the actor does not have the skill to repel the poison
if not actor.state?(NR_PoisonedTiles::Counter_State_ID)
# Poison the player
damage = NR_PoisonedTiles::Damage_On_Poison
actor.hp -= damage if actor.hp > damage
# Flash the screen if appropriate
if NR_Poisoned_Tiles::Flash_Screen
$game_map.screen.start_flash(Color.new(255,0,0,64), 4)
end
# Remove the state if appropriate
if NR_PoisonedTiles::Remove_State_After_Stepping
actor.remove_state(Counter_State_ID)
end
end
end
end
end
end
#==============================================================================
# ** End of Script.
#==============================================================================
*Edit*
I don't think that the tile_id's work in the same way you think it does. I've been looking through the code, and only the events tile_id will ever get set to a non-zero value, and that's based off the character graphic you give them.
I've redone the script, it has two parts now, this first script is supposed to be removed when you're finished setting up, and it simply shows a window that displays the tile ID's that the player is standing on
CODE
#==============================================================================
# ** Window_TileID
#------------------------------------------------------------------------------
# This window displays tile ID underneath the player
#==============================================================================
class Window_TileID < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# x : window X coordinate
# y : window Y coordinate
#--------------------------------------------------------------------------
def initialize(x = 0, y = 0)
super(x, y, 160, 3 * WLH + 32)
self.back_opacity = 200
@counter = 0
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
data = $game_map.data
px = $game_player.x
py = $game_player.y
width = self.contents.width
for i in 0..2
text = "Layer %d: %d" % [i, data[px, py, i]]
self.contents.draw_text(0, i * WLH, width, WLH, text)
end
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
@counter += 1
if @counter > 5
refresh
@counter = 0
end
end
end
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
# Edited to show the Window_TileID
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias nr_windowTileID_main main unless $@
alias nr_windowTileID_update update unless $@
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main(*args)
@id_window = Window_TileID.new
# Run the original main
nr_windowTileID_main(*args)
@id_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update(*args)
@id_window.update
return nr_windowTileID_update(*args)
end
end
And this second script is just like the previous poisons script, but you use the tile id shown from the previous script when you're standing on the poisoned tile, and it poisons the player when they're standing on it

CODE
#==============================================================================
# ** VX: Night_Runner's Poisoned Tiles Script.
#------------------------------------------------------------------------------
# History:
# Date Created: 6/Dec/2011
# Created for: RedMonkey
# @> http://www.rpgrevolution.com/forums/index.php?showtopic=54253
#
# Description:
# This script deals damage to players when they step on a poisoned tile.
# If an actor has a state active that counters the poison though they will
# not be damaged.
#
# How to Install:
# Copy this entire script. In your game's editor, select Tools >>
# Script Editor. Along the left hand side scroll all the way to the
# bottom, right click on the square after ( Insert here ), and select
# "Insert". Paste the code on the right.
#
#==============================================================================
#==============================================================================
# ** Customisation
#==============================================================================
module NR_PoisonedTiles
Tilemap_ID = 1600
Damage_On_Poison = 1
Counter_State_ID = 1
Remove_State_After_Use = true
Remove_State_After_Stepping = false
Flash_Screen = true
end
#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# Edited to deal damage on poisoned tiles
#==============================================================================
class Game_Party
#--------------------------------------------------------------------------
# * Alias Methods
#--------------------------------------------------------------------------
alias nr_poisonedTiles_on_player_walk on_player_walk unless $@
#--------------------------------------------------------------------------
# * Processing Performed When Player Takes 1 Step
#--------------------------------------------------------------------------
def on_player_walk(*args)
# Run the original on_player_walk
nr_poisonedTiles_on_player_walk(*args)
# If the player is stepping on tile 195
if get_maptiles.include? NR_PoisonedTiles::Tilemap_ID
# Loop through each player
for actor in members
# If the actor does not have the skill to repel the poison
if not actor.state?(NR_PoisonedTiles::Counter_State_ID)
# Poison the player
damage = NR_PoisonedTiles::Damage_On_Poison
actor.hp -= damage if actor.hp > damage
# Flash the screen if appropriate
if NR_PoisonedTiles::Flash_Screen
$game_map.screen.start_flash(Color.new(255,0,0,64), 4)
end
# Remove the state if appropriate
if NR_PoisonedTiles::Remove_State_After_Use
actor.remove_state(NR_PoisonedTiles::Counter_State_ID)
end
end
end
end
# If we remove the state
if NR_PoisonedTiles::Remove_State_After_Stepping
actor.remove_state(NR_PoisonedTiles::Counter_State_ID)
end
end
#--------------------------------------------------------------------------
# * Get the Tiles that player is standing on
#--------------------------------------------------------------------------
def get_maptiles
output_data = []
map_data = $game_map.data
px = $game_player.x
py = $game_player.y
for i in 0..2
output_data << map_data[px, py, i]
end
return output_data
end
end
#==============================================================================
# ** End of Script.
#==============================================================================