efeberk 84 Posted August 8, 2012 Simple Area States This script allows to add state to player when player reached a specific area Read Introductions in Script. Script : #~ ------------------------------------------------------------- #~ Script : Area States #~ Scripter : efeberk #~ Date : 09.08.2012 #~ Version : RMVX Ace #~ ------------------------------------------------------------- #~ Features : #~ This script allows to add state to player when player reached a specific area. #~ Example : STATELIST[0] = [3, 12] #~ This means : State ID 3 will be added to player when player enter # region ID 12. module EFEBERK STATELIST = [] #STATELIST = [state_id, region_id] STATELIST[0] = [3, 12] STATELIST[1] = [4, 30] end #~ Don't edit below if you don't know about scripting. class Game_Interpreter def update @fiber.resume if @fiber start_state end def repeat_actorid(param) if param == 0 $game_party.members.each {|actor| yield actor } else actor = $game_actors[param] yield actor if actor end end def repeat_actorvar(param2) repeat_actorid(param2) {|actor| yield actor } end end def start_state for i in EFEBERK::STATELIST if $game_player.region_id == i[1] repeat_actorvar(0) do |actor| actor.add_state(i[0]) end else repeat_actorvar(0) do |actor| actor.remove_state(i[0]) end end end end Share this post Link to post Share on other sites