Jump to content
Sign in to follow this  
efeberk

Simple Area States

Recommended Posts

Simple Area States

 

This script allows to add state to player when player reached a specific area

 

Read Introductions in Script.

 

21abv2h.png

 

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted