Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - gerrtunk

1
New Projects / [2k]Peyot War
April 26, 2014, 05:55:44 pm
Introduction
A very old, old story is behind this game. It is based on a shared and humorous/parodic/fantasy world created by a group of friends (usually having their basic level of high quality) from which it drinks deeply, however, the version now playing is the "International", more accessible to other people, better introduced, with further explanation of the world and ambience, and away from that too much self-reference point.

However, you should read the manual for some extra history, although not essential as you will be presented all in the game itself.

When some characters will appear or for some special things, these will be presented to you with a screen of description in which you can also change their name.

Notice that everything  that is here is pure humor, parody and fantasy and have to take it as such. Nobody hates independence, Catalonia or anything like that, is more nearly the opposite.

However , the case of Joan should be taken apart, of course .

Overall the game have a lot work, including many original graphics (which will go to more in future versions), content, game design, originality and quality story at least in his style.

Im going to traduce this history to english and i will introduce some extra things to the traduction and version to adapt it.

History
Long ago, the world fell into a war that had always been eternal. Important features such as underground moles, wicked melodicd  and the saviors day of the CMV caused such a catastrophe that sank the U.S. and Japan.

With the fall of that great powers and much more, the world has suffered a rebalance. Europe and China are spreading for world domination, the latter dominated by an ancient sect of unknown origin. And in general, new problems arise with factions and enemies around the world, as well as new adventures... and new heroes.

Join the resistance.

In Barcelona, ??a Spanish city(a Catalonian one, to be more exactly), that's now controlled by the OGI(Organical Government of Independence ), an old veteran rebel group has decided to meet again and act once again, this time his ultimate goal is to defeat Peyot, which participates in a conspiracy to take the Generalitat and Spain... if you leave him.

This guy in addition to being leader of the independentists, has kidnapped the girlfriend of one of the rebels, and because of the betrayal of a former colleague, has taken over the unpredictable ball, an ancient artifact of immeasurable power. Although still do not know quite how he has done that, Peyot injected the ball in itself, achieving a brutal power and going increasing as his affinity with the same increases.

Someone must stop him before he becomes invincible with a high level affinity!

Gameplay
This game uses the system default rpgmaker 2000, with these frontal and strategic combats. However there are some new things and details to consider, among many others:

- There are several subsystems / places to go at any time , The Zombie Realm, from a member of the party, the area of Trainers thats very complex and a beta testers Cemetery... all with more things to unblock in the future
- Many secondary things to do.
- The game system is based on 3 main characters that have hardwork and have complex skills, design and engines and subsystems behind them(and in coherence with the ambience of each). Note that there are some minor characters who enter here and there from time to time of course.
- Two difficulty levels , normal and Lazy mode, the Lazy is for sooo lazy , XD, or absolute novice , really and you can up the difficulty level when you want, but not the opposite. Also includes a guide , manual and tutorial area.
- Gameplay with a broad of minimum depth , options, variety and strategy as well as challenge.
- Many adventure things, plot stages and phases, things to consider, scenes, minigames, and details, the some enemies are on the map while not are fixed events , there are things to do in the dungeons that  are realted to his ambience , etc. etc.

Among other things of course.


Characters

In the game there are two types of characters, main and secondary ones . The 3 protagonists are used for most of the game, and have more weight.
And then there's a large group of secondary, that you can handle the majority, and with less complexs skills, like the legendary spy robot posh Pere_87 which combats againts Peyot in the prelude.

Victor
The leader of the group due to the nature of his mission: Kill Peyot and rescue his girlfriend thats "kidnapped". He is in the 7th Kung Fu Kiei arts , training day and night to keep in shape, but not get carried away by his powerful critical attack rate and high strength, is also part of the trio of founders of the CWL(Confederation of World Lazyiers), besides had created their own branch of magic Ultima, among other things.

Although it is the best fighter, with his skill Kung Fu that make a particular damage to an enemy or group, also has other qualities as the use of some powerful magic and a good balance in general. Also has the option to use special items that are received in a very strange way and can not be obtained in any other way.


Galiana:

It is another member of the old CWL. One of its biggest advantages is undoubtedly its extensive experience in the world of the game and in particular the jrpg, so it will be the perfect guide the group in many situations. Fan of ukuleles, always carries one with him and can organize a concert or use a powerful musical attack. His favorite attack is Lightning 1 since he played his first game in a Final Fantasy, and from overuse of it, its now perfected and taken to brutal levels of damage.

In combat, is notable for its use of a legendary magic with ukulele playing songs that last the entire battle, thus helping the group in various ways. It also has a number of different arts that has learned during the game and in general that may be used mostly in the map but sometimes also with some enemies and serve as very useful unique skills map.

Ian
It is the largest of the laziests that have given the story and a powerful former member of the CWL. It carries everyware a sleeping gear and always gets sleepy in the worst situation possible. Fan of comics, zombies, and this and that, is rather oriented skills and magic character as it has dangerous shortcomings, like its mutant tin-plate shoulder.

Ian is also the mage of the group, being weak and not very agile, possesses skills that cause laziness on the enemy as well as his own ability to sleep the whole group to recover them, but also has elemental magics and other very useful. Note that also has the capabilities to invoke certain beasts in combat by using summoning stones that have limited uses, so as to obtain benefits from its Realm of Zombies...
Besides various other future additions and new surprises.

Captures(the most part of the graphics are original)
Spoiler: ShowHide


The dungeon of the demo, the tiles and wolf the only no original.

A combat with a orignal boss

The chapter conection system, with very custom ngs

The final boss of the game
A prologue scene

The tutorials area, full custom graphics

The character presentation system, in spanish for now


State

The game is completed in the prototype 3.1 version, it needs a traduction and then i have to include a new scene to it, to adapt the history a world level, and then, i will publicate it. About the traduction i will make the full work and later it will give a final test to gamer o to a expert person...

Notice that is a prototype used to show and test things so are some basic things that will change in next versions, like the escalation of access to parallel worlds which is very fast, and some content that are cutted. Im doubting if design enemies of 0 apart from the boss and little else, like bosses. Note that use rtp npcs for now, but not much.

The game have many things about FF or other references that makes sense in that world and that particular style and parody.

After this, the game will be made ??from start to finish, despite being made ??by chapters, and probably presented in its final version only, that will be the duration of a short game, about 8h at best, and will also include improvements to the current section now you are going to play among other things, like more original content here and there.
2
Introduction
This is my more complex and longest to create project(3+ years from now). It have a lot of design and script work, and a old 2k project. This is also my only 'normal' project, like a traditional adventure, with its mapamundi, decent duration, etc.
Note that altought im spanish, i will traduce it as best i can.

This game is a tribute to the calssics. Im going to add a very classic charm in any way, but refreshing and improving it(and originality), and not using simple history althought just for the sake of being classic (but i will have a simple and open main script, of course).

I also want to create a world and systems without any generic or filler things. The intensity is the key.
Finally, this game tries to narrate at maxium using the gameplay. It will exist always strong coherence with history and gameplay.

Scripts:

Im developing a lot of complex scripts for this game. 99% of my published scripts where originally created to be used with this game, and they will have its finals versions for this game.

Graphics and sound
Im going to use 16 bits styled gaphics in XP, because i love pixel and because i want to tribute the classics.
With the music althought, no original soundtrack, at least for now.
This is the project where i debate if use totall custom graphics or not. One of the problems are the enormous locations types that exist and will require a custom tileset.
My idea is that my spriting skills grow and grow more when working in each of the short games, that will have more and more custom things. But the problem will be the time needed. Anyway i will get with that in the future and release or work without custom tilesets at the start.

History

Ghy quitly sleeps in his room. But something happens, a intense explosion flood the house. His city is burning, and the noise and the lights increment at each moment.
When all seemed lost appears a extrange cat, cast a spell to the window and scape from it. Ghy cant a choose and he follow the cat in his new adventure.

The game script is very relaxed, dont look for very intensive or overloaded script, or a main complex argumental thread that guides you. In this game subhistory rules. What i try is that each part of the world have his own personality and be very intense, without any filling.
The history is based in the more surrealist or infantil fantasia like Ende, Carroll, Lewis, and even Grim or Andersen.
Note that this game have TONS of humor also.

Characters

-Ghy: His immediate objective is to find the cat to return to his world, but that wont be easy.
In combat is a complicated character, having a hidden immense power for large place. He is the only that can use the items from his world, that have strange powers here.

-Ralaa: Is the girl who Ghy meets when enters in the new world. Is the son of clan boss and she will have to leave beacuse she opposes to the slave desttiny of it.
In combat is the more flexible character and can talk with the enemies, using a very complete system for that.

-Naiala: Is a exiled pursued by the two kings and that hidde a ancient power.
She is a defensive character that can read the enemies information. She also have predictions that will help the party in the adventure.

-Iua: A little animal spirit that travels with Naiala and is also is exiled.
In combat can summon giant colossus, althought she have atribute ranges inverted and cant use the normal resources.

-Rarlie:
Is a thief kid . His main objectivo is to rescue the secret closed in a magic book.
He can steal from the enemy and have useful skills to evade enemies.

-Eldrik: A powerful warrior from the dominating city of the world.
He's strong point is the physycal combat, with skills more simpler and with less resources consume.

-Alisa: Is a misterious kid that you will meet in your adventure.
In combat his main value is randomes, althought she is the most powerfull character in the game.

Gameplay

This game is so classic, with the balance and basic ideas of DQ, althouht it have a lot from FF and PS also. It will use classic mapamundi, dungeon, and frontal/turn combat system. Anyway, a lot of the combat ideas are original and much of the systems and interactions too. They are based a lot in the occidental rpg complexity and features but without the things that i dont like from they: the fault of a strong desing, making them too generic and empty.

-Argumental tree, replayability:
One of the basis of the game is the freedom and the replayabilty. Each of the characters class tree is also a argumental one, but the main idea is that the game is going to have a lot of decisions and changues that you wont see just in the ending(althouth there are like 15) but in the full game.

-Exploration, secrets: Obviously it will give you a great freedom to replay the game, explore, find secrets, sidequests, etc. Note that this game will expand classic NES mapamundi exploration and will be more like zelda or PS or DQ where you will make little adventures in the mapamundi.

-Characters system:
17+ characters in the game. 7 main characters and 10+ secundaries. Each character have 3 skills. Note that this game dont use any complex skill system, the basis of this game are the characters that have very complex custom skills and roles.

-Special custom skills: One of the best things of this project, at least for me. Each character will have custom skills and features that are pretty original and can be very, very complex, being each one like small systems iteself. Each main character have 3 and each secundary 2.

-Class system: Each of the main character can develop to 7 subclasses.

-Tactics system. The enemies and party share a table, with 3 basic positions with different effects based on the situation. Include a menu to changue it. Note that characters positions affect the relations system.

-AI system. My hardest script to create and my personal challengue with RGSS, a complete AI script usable for all battlers. It will make that enemies have improving inteligency based in his role, so if you fight with a sage-human for example, he will estimate the complete battle strategy, use and register elemental or status resistencies, help his allies, etc(like 14 things in total).

-Item system. Uses a improved DQ inventory, where also exist a weight for items. With each actors bag, improved menu display with the 4 actors and the same time, and use of item weight. I also added a lot of interface improvement so its really nice to manage items in any situation, with a lot of functions, ordering, equipment in the menu, discarding, transfering groups of items of each players between players, etc.

-Challengue: This game will be very hard to beat, having 3 difficulty levels: one like ffvi, other little more hard than ffv, and the other like old NES RPG's. Im planning to add a few systems to balance challengue each time(a script i created) or just a small status autobalance, custom difficulty systems and the option to changue it any time.

Captures
Spoiler: ShowHide







Note that all is improvable and temporal, i will do full custom things probably.

Status

This game is my more complex thing to create. It started in rpmaker 2k with SMP and SBP but i moved to XP.
Note that i try to make two projects at the same time, ore more simplier and short, but more original and risky, and then this, that i will have to work in it for a lot more years. I will be releasing some short projects when working in this complex project(i have like 3 or more).

To have a prototype, althought without the AI(and some patches for the occasion, AI is the more complex system to create) and custom graphics, For that i have all the design created but for the 2k version, but it dont take a lot to changue that. That will let me atleast check the gameplay and all in a non design document way.

Note althought that this isnt the full description. I reserve a lot of things and a lot extra surprises, and more complexity for each one of the writed here.

Finally, the screens are of the spanish version, and the old 2k one, except the item menu, where all the graphics are temporal.

After completing the first two rpgmaker prototypes(i have to traduce them only), im working on this one as the main one, and Ordra as secondary one, but now i switch more.

The game will have its own prototype with its two versions, and the other, more complete, including the worldmap and a dungeon.

Now im correcting the graphic conversion from 2k to XP(autotile's are the main problem) and finishing original graphics. I think that i will do the majority original except of xp autotiles that i dont understand very well for now.

Im creating the maps and gameplay basically, because the desing is very advanced. The first prototype will include two battles, a prologue and a town, and will last like 40m. The second one, like 1,30h.

The scripts have to be poluted something. I have to switch my compatibilitzet scripts with Improved Battled 4.0 from Larderan/The last night and make small changues here and there. Not much work, anyway.

I cant give a real date, but im not taking a lot.

Well, im advancing a lot with this game because this is my principal project now.

I have created some new graphics, i have to depurate and terminate the tileset and the boss.
Spoiler: ShowHide



A little serpent. For now i will use imported battlebacks or created from the tilesets.

The main problem its the scripts. I have to do a prologue section and the village, but the most
time consuming is to debug the scripts i have actually created lots of years ago.

I will cut some other things for the prototype as there are like 2 battles only, but the tactics system have to be there, of course.
3
Introduction
This project also start with the idea of more little and simple project. I'm constantly having new ideas and testing things and i selected this.
Note that i'm spanish and for now i will by traducing it as good as i can.
The game have a nes or 8 bits style. Note that i wont limit to that game recipe.

Engine & Programing
I'm using RPG Maker XP because it saves a lot of time when creating RPG's and you can also can customize everything. But i am a skilled RGSS scripter with more than 40 scripts created for now and i am using a full set of custom scripts for my games.

Graphics and sound
My plan is to have a full custom graphics and music. I have started to make my own graphics and i will try with the music later, or hire someone, or use special free music. Note that for the prototype i don't use all custom and they are worse than in the final version

Plot
The game plot is situated in the place where a lot of other games wouldn't want to end: when the devil have triumphed and rule the world. Its also in a perpetual night.

You form a group of shadow anti-heros that served Effe, who have shadowed the world.

And one of the his used methods have been give special talents to his allies so they serve he better and defeat the light forces. But with the main war ended, Effe demands his talents, and he will send you to recover and bring them.

Characters
The group that i was talking later is composed of four powerful shadow warriors. Anyway after the war and the Larderan(the shadowing of the world) all have after-effects and also the group-s girl have felt in a strange comatose state.

Anyhow it will have some more characters and some secret ones. But for now i will only show the three main characters.

Hanow
A Sagash warrior and the adventure protagonist. Its a mute character although it will be in a new improved way.
Sagash's are magic warriors but mediocre and rare in combat. They are very good resisting altered states. At last Hanow have also a relation with Enna that now is broken.
 
Klide
A cursed man that now is trapped transformed in a monster. Is a agile and versatile character although somehow limited in that all his equipment is unique. Stands out in the altered states use.

Tebar
A strong men that have a legendary and powerful mallet, that he cant use now because he lost his arm. Hi will substitute this will some options and custom systems.

Gameplay
Obviusly the game is inspired in the 8 bits rpg's. Frontal turn combat and no save in dungeons or worldmap, limited item number, open worldmap and adventure, deduction and search of pistes, mazes, etc. Anyhow the game will include some original things:

-We can equip the dones that we recibe
-The altered states have been improved and grow in importance
-A improved combat positions system
-It will have a diversity in gameplay
-A collect items system for a lot of things
-A lot of freedom, sidequest and also three small worlds to discover
-You can interact with the dark zones of the world and try to restore or enter in them
-Some gameplay and plot decisions unique for each playthrough.

Other things
Note although that this isn't the full description. I reserve a lot of things and some extra surprises, and more complexity for each one of the wrote here.

The game will have also a improved paid version, but it will be in all terms a opensource and CC game.

Actual state
Public prototype 1.5 publicated. This version like we said before is multilanguage and includes two languages with it's owns walkthroughs and manuals. It also have a few improvements over the original spanish version.
Note that the traduction i suppose that will have some mistakes that i will correct if anyone report but i think it have a decent state and the game is fully playable.

Finally there are a lot of things that aren't totally implemented or polished in this version and that i already know. You can check them in the manual and in the main topic of the game.

Later i will update this new version a little if it have mistakes, and then i will work for the second protoype, wich will include more contents and all the other scripts and systems and the final polishment of the actuals, including creating maybe a total custom graphics. After that i will wait for the final version.

Download:

http://www.mediafire.com/download/2x5wza1e2s7zaw1/The+last+night+1.5.zip

About screen captures
They are from the spanish version and have a mixed of original graphics and not. Anyhow the originals graphics are the majority for now, but i have to be improving and upgrading them a lot, some of them are just temporal ones.









Some things at a partial state or to improve in general(And to solve it in future versions):

-The graphics of green small beach areas in the map of the island. They are shown over the characters. But what do not how to do it because with the system of xp is very rare i will rethink and redo that in some moment. For that reason the coast are not made ​​of the world map.

-After taking a chest it disappears instead of being open. No graphics of open chest and the same, i will not change now if im not going to do my owns. Note that some old classics games use this and im thinking if im going to make it or not, its not that bad.

-At the end of the battle there is a moment in which the growing music and postbattle sound coincide, it's nothing very serious but might take it off, i wanted to contact the author of the script but the website where this was temporarily off, and in another is reported but unanswered. We will have to wait.

-The game generates a small text file called Primer prototopio 2.0-0-Diario or something. This document is a diary of the game with information about your game in various important moments as well as the end to it. Obviously it is useful to test and develop and see how the game has gone. You can post it or if you want to read it its ok.

-When naming the character I get some strange characters in the blanks spaces. I was unable to locate the bug but im making another version, just type the name and do not worry as these are not seen in the game itself then only in that scene. Note that im looking to see if any other people see that good or bad.

-There are missing accents and stuff like that in the game. But they are not just misspelled, just  missing some details as accents that are not me and because my keyboard or computer has a problem and write the rare keys. This will correct for in some next version that will be traduced and let more easy way to deal with that.

-About the MCI and the subject of codecs and such can annoy and i have already sent a suggestion to the scripter to put them in a pack, besides that if it give testing problems or something, and that solve the majority of bugs of convertion and compatibility. But i could make an installer for the game or a general installer version. Anyway being a super small installer should not bother much or i could seek for other alternatives, such as being able to choose between using or not using another script or  whatever.

-The game will have a limited script and system objects but for this version uses default as it was not necessary, because of its low duration and do not access the people, so save me implement it for now.

-The save and die system is also test, and I've been thinking of putting a variable that has some kind of penalty to lose the fighting, for example, 5 percent of your total money that will be multiplied for each time you lose. Although it is not easy to do and can jump. Im doubting.

-Some things are half make or quick fixed, like post combat chests and some other like traps are made by hand by now simply, then i will finish. Like with most things, such as faces, especially that of Hanow, or a pair of transitions when changing colors. There are also other details to get better that I will include for example the menu, some graphics or system interface positions, a unique exploration system among many more. Maybe I also included a climber difficulty and even a unique sense this configurator.

-Includes guide and manual. Use the guide with wisdom.

-I suppose that last about 40m or a little more.

-It also gives me a small error but only seems to happen to me, if I deactivate the musics in the configurator of the game, can still be heard, I have to do from the windows audio control or via script. Rare because only happens in this... i will see if the error is mine alone or not.

-The cutscene skip system have a rare bug, because if after a scene with a combat you press to jump it will immediately not load the monster graphic, more rareey is that this does not seem to happen if the graphic is in the rtp (and not by the file format). In any case having a elections system after combat with boss system, and you can save too, but still try to wait a few seconds before pressing it or it wil prevent more or skip that scene.

-The save script seems to have a bug when loading and not just quite remember what was the last saved game and it defaults to 3.

-In the future the language selection will appear only one time and it will be configurable in the menu. It will include english as default too.

Credits, resources and licenses:

-Using free music basically, especially from free internet and sites like modarchive and FreeMusic. The sounds I've made ​​all by myself with http://www.bfxr.net/ program. Will detail this better later complete with all major credits. All with free licenses. There is a sound of dragon quest nes, to take the box. The music of Ordak is of a commercial game.

-The game includes 19 scripts fully mine, 4 modified or created between several and 3 of other people. Now uses the improved battle 4.0 script which has millions of corrections and improvements though half of this done. Use the default battle system which im adding my small scripts and details over time too. By gerkrt, gerrtunk.

-Graphics. FF and DQ nes games used as a base (taken from the dragon fantasy game basically) for inspiration for mine but i use some in the game itself too. More than half of the enemies are mine. No chara is mine, but the faces, and many tiles of the maps, almost almost the majority. As for animations i have done all sounds and resources are all made ​​by me, except a couple (the chest and the animation which use temporarily for various altered states, but they are edited of course). In the future, I will make more.

-The license of my graphics and resources is Creative Commons At- Nc- Sa. Scripts is MIT.
4
Im trying to modify the equipitem window so each time it refreshes it shows a different type of equipment piece, not using a large number of them for each piece.

This is a modification creted for my golem system. Note that the window is refreshed and changued the slot each time its moved the cursor in the equip right slot window.

My problem is that the bitamp isnt erasing. It draws but there is also the last draw, and so on.
This code is executed so i dont get whats happening:

    if self.contents != nil
      #p'nil'
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.clear
      self.contents.dispose
      self.contents = nil
    end


#==============================================================================
# ** Window_EquipItem
#------------------------------------------------------------------------------
#  This window displays choices when opting to change equipment on the
#  equipment screen.
#==============================================================================

class Window_GolemEquipItem < Window_Selectable
  attr_accessor   :slot_index
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor      : actor
  #     equip_type : equip region (0-3)
  #--------------------------------------------------------------------------
  def initialize(actor, equip_type, slot_index=0)
    if actor.is_golem?
      super(0, 256, 272, 224)
    else
      super(0, 256, 640, 224)
    end
    @slot_index = slot_index
    @actor = actor
    @equip_type = equip_type
    @column_max = 1
    refresh
    self.active = false
    self.index = -1
  end
 
  def changue_slot (slot)
    @slot_index = slot
    refresh
  end
 
  #--------------------------------------------------------------------------
  # * Item Acquisition
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
 
  def test
    #p @data
  end
 
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
   
   
    if self.contents != nil
      #p'nil'
      self.contents = Bitmap.new(width - 32, height - 32)
      self.contents.clear
      self.contents.dispose
      self.contents = nil
    end
   
    @data = []
   
    if @actor.is_golem?
      #p'gol'
      # Add equipabble pieces
      for i in 1...$data_items.size
        # Only add pieces that exist, that are pieces, are equippables for
        # the actor and for the slot
        #p i, slot_index
       
        #piece_id = Piece.item_piece_id(i)
        if $game_party.item_number(i) > 0 and Piece.is_piece?(i)
          #p 't'
           if Piece.equipable?(@actor.actor_id, i)
            #p 'tst', i
            #p slot_index, @actor.golemslots[slot_index].type, Piece.item_piece_id(i)
           
            if @actor.golemslots[slot_index].equipable?(i)
               #p 'pushed', i
               @data.push(Piece.new(Piece.item_piece_id(i)))
            end
             
          end
        end
      end
     
      #p @data
    else
      # Add equippable weapons
      if @equip_type == 0
        weapon_set = $data_classes[@actor.class_id].weapon_set
        for i in 1...$data_weapons.size
          if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
            @data.push($data_weapons[i])
          end
        end
      end
      # Add equippable armor
      if @equip_type != 0
        armor_set = $data_classes[@actor.class_id].armor_set
        for i in 1...$data_armors.size
          if $game_party.armor_number(i) > 0 and armor_set.include?(i)
            if $data_armors[i].kind == @equip_type-1
              @data.push($data_armors[i])
            end
          end
        end
      end
    end
    # Add blank page
    @data.push(nil)
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
   
    for i in 0...@item_max-1
      draw_item(i)
    end
  end
 
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    #
   
    item = @data[index]
   
    #p 'di', index, item, item.name
    x = 0 #4 + index % 2 * (288 + 32)
    y = index * 32 #index / 2 * 32
    if @actor.is_golem?
      number = item.number
     
    else
      case item
      when RPG::Weapon
        number = $game_party.weapon_number(item.id)
      when RPG::Armor
        number = $game_party.armor_number(item.id)
      end
    end
   
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
   
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    # originalment, 240, 256
    self.contents.draw_text(x + 128, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 144, y, 24, 32, number.to_s, 2)
  end
 
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
 
end
5
Retro-Styled Battle Result Window
Authors: gerrtunk
Version: 1.1
Type: Battle result modification
Key Term: Battle Add-on



Introduction
This scripts lets you use a retro styled battle result window, like FFVI for
example, where a small window on the top shows line per line the information.



Features

But i expanded that. You can configure what you want to show or not and how it will
be shown, grouped or not, and what number of lines will have the window.

Finally you can use a wait key mode or a wait time one.



Screenshots



Demo
No.


Script

Spoiler: ShowHide



#==============================================================================
# Retro-Styled Battle Result Window
# By gerkrt/gerrtunk
# Version: 1.1
# License: GPL, credits
# Date: 22/08/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

--------Introduction-----------

This scripts lets you use a retro styled battle result window, like FFVI for
example, where a small window on the top shows line per line the information.

But i expanded that. You can configure what you want to show or not and how it will
be shown, grouped or not, and what number of lines will have the window.

Finally you can use a wait key mode or a wait time one.

------Instructions-------------

First you have to select what you want to see. To do that use the option
Things_to_show. This is a list of codes so if the code is here that option
will be shown. The codes are:

:level_up, :gain_skill, :win_phrase, :gold, :exp, :treasures

Later you can configure the number of lines of the window in Lines_to_show.
The retro games used 1, but you can add more lines to the window so the
messages are shown faster.

Show_levels_in_one_line = true

These options define if for example it says , actor level up! actor level up!
or actor level up!(2). true/false, active and inactive.

------Vocabulary-----

The last options are the words the system show in the window. You can changue
that.

Also you can configure battle wins phrases for each enemy troop.

  Battle_wins_phrases = {
    2=>'Wep winned again2',
    3=>'Wep winned again3',
  }
Where X=> is the troop id number and 'text' is th eprharse, respect the syntax.
Note that exist a default option for the ones that dont have a entry here.

-----Compatibility----

You can desactivate the modification of the battle status windows, thats the one
used for draw character info in battle.

Modify_window_battle_status = false

=end

module Wep
  Show_levels_in_one_line = true
  Lines_to_show = 1
  Things_to_show = [:level_up, :gain_skill, :win_phrase, :gold, :exp, :treasures]
  Modify_window_battle_status = true
  Gain_level_phrase = ' level up'
  Gain_skill_phrase = ' learned'
  Gain_gold_phrase = ' gained.'
  Treasure_gain_phrase = ' gained.'
  Gain_exp_phrase = ' Exp gained.'
  Battle_win_default_phrase = 'Wep! You win!.'
  Battle_wins_phrases = {
    2=>'Wep winned again2',
    3=>'Wep winned again3',
  }
 
end


if Wep::Modify_window_battle_status
#==============================================================================
# ** Window_BattleStatus
#------------------------------------------------------------------------------
#  This window displays the status of all party members on the battle screen.
#==============================================================================

class Window_BattleStatus < Window_Base
   #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      draw_actor_name(actor, actor_x, 0)
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags[i]
        #self.contents.font.color = normal_color
        #self.contents.draw_text(actor_x, 96, 120, 32, "¡Sube Nivel!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
  end
end

end


#==============================================================================
# ** Window_BattleResult
#------------------------------------------------------------------------------
#  This window displays amount of gold and EXP acquired at the end of a battle.
#==============================================================================


class Window_BattleResult < Window_Base
  attr_reader   :messages_max
  attr_reader   :messages_index
 
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     exp       : EXP
  #     gold      : amount of gold
  #     treasures : treasures
  #--------------------------------------------------------------------------
  def initialize(br)
    @br = br # get battle result
    @messages_index = 0 # shows the actual mesage of the window
    @messages = [] # array of mesages: exp, gold,e tc
    super(0, 0, 640,  (Wep::Lines_to_show * 32) + 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.y = 0
    self.back_opacity = 160
    self.visible = false
    generate_messages
    refresh
  end
 
  #--------------------------------------------------------------------------
  # * Generate messages
  # This extracts all the information of the battle result and push it in the
  # messages list as phrases
  #--------------------------------------------------------------------------
  def generate_messages
    i = 0
   
    # Win phrase
    if Wep::Things_to_show.include? :win_phrase
      if Wep::Battle_wins_phrases[$game_temp.battle_troop_id] != nil
        @messages.push Wep::Battle_wins_phrases[$game_temp.battle_troop_id]
      else
        @messages.push Wep::Battle_win_default_phrase
      end
    end
   
    # Gold & exp
    @messages.push @br.exp.to_s + Wep::Gain_exp_phrase if Wep::Things_to_show.include? :exp
    @messages.push @br.gold.to_s + ' ' + $data_system.words.gold + Wep::Gain_gold_phrase  if Wep::Things_to_show.include? :gold
   
    # Actors iteration
    for br_actor in @br.actors_data
     
        # Check diff so can gain levels or exp
        if br_actor.gained_levels > 0
         
          # LEVEL UP. If actived to show levelup, use configurated method
          if Wep::Things_to_show.include? :level_up
            if Wep::Show_levels_in_one_line
              @messages.push (br_actor.actor.name + ' ' + Wep::Gain_level_phrase +
              "(#{br_actor.gained_levels}).")
            else
              for lv in 0...br_actor.gained_levels
                @messages.push (br_actor.actor.name + ' ' + Wep::Gain_level_phrase)
              end
            end
          end
         
         
          # SKILL GAIN UP. If actived to show skill learn, use configurated method
          if Wep::Things_to_show.include? :gain_skill
             for skill_id in br_actor.gained_skills
                @messages.push (br_actor.actor.name + ' ' + Wep::Gain_skill_phrase + ' ' +
                   $data_skills[skill_id].name + '.')
              end
     
          end
       
        end
       
      i += 1
    end

    # Tesoros
    if Wep::Things_to_show.include? :treasures
      b = Hash.new(0) # use this hash to count duplicates
     
      # iterate over the array, counting duplicate entries
      @br.treasures.each do |v|
        b[v] += 1
      end
     
      b.each do |k, v|
        @messages.push k.name + '(' + v.to_s + ')' + Wep::Treasure_gain_phrase
      end
    end

  end
 
  #--------------------------------------------------------------------------
  # * Refresh
  # Refresh with new messages each time.
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if @messages[@messages_index] != nil
      # Use lines configuration
      if Wep::Lines_to_show == 1
         self.contents.draw_text(0, 0, 640, 32, @messages[@messages_index])
      else
         for i in 0...Wep::Lines_to_show
           # It adds the line count to message index to show more lines
           if @messages[@messages_index + i] != nil
             self.contents.draw_text(0, i * 32, 640, 32, @messages[@messages_index + i])
           end
         end
      end
      @messages_index += Wep::Lines_to_show
    end
    # When false, it will end battle
    if @messages_index >= @messages.size - 1
      return false
    else
      return true
    end
  end

end


module Wep
  Scripts_list = [] unless defined? Scripts_list
  Scripts_list.push ('Retro-Styled Battle Result Window')
end


#==============================================================================
# Battle Result
# By gerkrt/gerrtunk
# Version: 1.0
# License: GPL, credits
# Date: 22/08/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

--------Introduction-----------

I created this class so anyone can easily create a custom or more advanced
battle result window. This object gives you all the information need in a simplier
way and without a lot of trouble. It creates a array of party actors with:

-Array of learned skills ids of each actor
-Gained levels
-Actor referen ce
-Origin and ending exp and levels
-All the default info(gold,etc)

------Instructions-------------

You just need to give to it the initial levels of the party. For that, i put
here the sample code i use in scene battle start_phase5

    initial_levels = []
    for ac in $game_party.actors
      initial_levels.push (ac.level)
    end
   
    You only have to pass that array.
   
   
=end



ResultActor = Struct.new( :actor, :origin_level,  :gained_skills,
  :gained_levels)

class Battle_Result
 
  attr_reader :actors_data
  attr_reader :exp
  attr_reader :gold
  attr_reader :treasures
 
  #--------------------------------------------------------------------------
  # * Initialize
  #--------------------------------------------------------------------------
  def initialize(initial_levels, exp, gold, treasures)
    @actors_initals_levels = initial_levels
    @exp = exp
    @gold = gold
    @treasures = treasures
    @actors_data = []
    generate_data(initial_levels)

    #p @messages
  end
 
 
  #--------------------------------------------------------------------------
  # * Generate data
  # This method generates the object data.
  #--------------------------------------------------------------------------
  def generate_data(initial_levels)
    i = 0
    # Actors gain level
    for actor in $game_party.actors
      @actors_data.push (ResultActor.new(actor, initial_levels[i], 
      [], 0))
      count = 0
      # Valid actor?
      if actor.cant_get_exp? == false
        difference = actor.level - @actors_initals_levels[i]
        # Check diff so can gain levels or exp
        if difference > 0
         
          # LEVEL UP.
          @actors_data.last.gained_levels = difference
         
          # SKILL GAIN UP.
          for lv in 0...difference
            # If it have skills learning
            for lea in $data_classes[actor.class_id].learnings
              if lea.level ==  @actors_initals_levels[i] + lv
                @actors_data.last.gained_skills.push (lea.skill_id)
              end
            end
          end
        end
      end
      i += 1
    end
  end

end



module Wep
  Scripts_list = [] unless defined? Scripts_list
  Scripts_list.push ('Battle Result')
end



#==============================================================================
# ** Scene_Battle (part 1)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  alias wep_rbr_sb_main main
  def main
    @br_mark_end = false
    wep_rbr_sb_main
  end
 
  #--------------------------------------------------------------------------
  # * Start After Battle Phase
  # moded to extract initial levels and call battle result
  #--------------------------------------------------------------------------
  def start_phase5
    # Obtain extra info for battle result object
    initial_levels = []
    for ac in $game_party.actors
      initial_levels.push (ac.level)
    end
    # Shift to phase 5
    @phase = 5
    # Play battle end ME
    $game_system.me_play($game_system.battle_end_me)
    # Return to BGM before battle started
    $game_system.bgm_play($game_temp.map_bgm)
    # Initialize EXP, amount of gold, and treasure
    exp = 0
    gold = 0
    treasures = []
    # Loop
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        # Add EXP and amount of gold obtained
        exp += enemy.exp
        gold += enemy.gold
        # Determine if treasure appears
        if rand(100) < enemy.treasure_prob
          if enemy.item_id > 0
            treasures.push($data_items[enemy.item_id])
          end
          if enemy.weapon_id > 0
            treasures.push($data_weapons[enemy.weapon_id])
          end
          if enemy.armor_id > 0
            treasures.push($data_armors[enemy.armor_id])
          end
        end
      end
    end
    # Treasure is limited to a maximum of 6 items
    treasures = treasures[0..5]
    # Obtaining EXP
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.cant_get_exp? == false
        last_level = actor.level
        actor.exp += exp
        if actor.level > last_level
          @status_window.level_up(i)
        end
      end
    end
    # Obtaining gold
    $game_party.gain_gold(gold)
    # Obtaining treasure
    for item in treasures
      case item
      when RPG::Item
        $game_party.gain_item(item.id, 1)
      when RPG::Weapon
        $game_party.gain_weapon(item.id, 1)
      when RPG::Armor
        $game_party.gain_armor(item.id, 1)
      end
    end
    # Make battle result
    br = Battle_Result.new(initial_levels, exp, gold, treasures)
    @result_window = Window_BattleResult.new(br)
    # Set wait count
    @phase5_wait_count = 100
  end
 
  #--------------------------------------------------------------------------
  # * Frame Update (after battle phase)
  # moded so refresh battle result each time until it ends
  #--------------------------------------------------------------------------
  def update_phase5
    # If wait count is larger than 0
    if @phase5_wait_count > 0
      # Decrease wait count
      @phase5_wait_count -= 1
      # If wait count reaches 0
      if @phase5_wait_count == 0
        # Show result window
        @result_window.visible = true
        # Clear main phase flag
        $game_temp.battle_main_phase = false
        # Refresh status window
        @status_window.refresh
      end
      return
    end
   
   

    # If C button was pressed advance battleresutl info
    if Input.trigger?(Input::C)

     # Battle end only if +1 refresh of the window,so, the last have to
     # be pressed
     if @br_mark_end
       battle_end(0)
     end
     
     if not @result_window.refresh
       @br_mark_end = true
     end
     
    end
   
  end
end






Instructions
In the script.


Compatibility
In the script


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.
6
RMXP Script Database / [XP] Multiparties system
July 14, 2011, 02:27:51 pm
Multiparties system
Authors: gerrtunk,gerkrt, modern algebra
Version: 1.1
Type: Player / Party / Troop Add-on



Introduction
I ported this multiparties script from VX to XP, can do things like FFVI, but also saving gold,
items,etc.


Features
Other features explained in original script.



Screenshots
No.


Demo
No.


Script

Spoiler: ShowHide


Code: text

#==============================================================================
#  Multiple Parties Xp
#  Version: 1.0b
#  Date: July 26, 2011
#  Ported by: gerkrt, gerrtunk
#  Small Fix by: Twb6543
#  Idea to port: TheRealDeal
#  Link:
#  http://forum.chaos-project.com/index.php/topic,10097
#
#  Original Author: modern algebra (rmrk.net)
#  Link to Original VX version:
#  http://rmrk.net/index.php/topic,25710.0.html
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Description:
#    This script allows you to maintain multiple parties (separate item lists, steps,
#    everything) and allows you to merge them at will. Primarily useful for a
#    game where parties split up or a game where you can have separate parties
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Instructions:
#    Place this script under ? Materials in the Script Editor.
#    There are several codes to keep in mind:
#
#      $game_parties[id]                :accesses the party located in that index.
#                                       :creates it if it does not yet exist.
#      $game_parties[id] = X            :Sets the party to X. It MUST be a 
#                                       :Game_Party object
#      p = $game_parties.merge(id1,id2) :merges two parties and saves them in p
#      $game_parties.merge! (id1, id2)  :merges two parties and saves them in
#                                       :$game_parties[id1] and deletes $game_parties[id2]
#      $game_parties.delete (id)        :Deletes $game_parties[id]
#
#    In order to switch the current party, just do this:
#
#      $game_party = $game_parties[id]
#      $game_player.refresh
#
#    By default, the original party is saved in $game_parties[0], so you may
#    want to avoid overwriting $game_parties[0] and just work with 1,2,...
#
#    Also, be very careful when dealing with parties. Always remember what
#    parties exist and where they are in $game_parties or else you may make a
#    stupid error occur.
#
#        *EXAMPLE EVENT*
#
#      @>Change Items: [Potion], + 1
#      @>Change Gold: + 50
#      @>Script: p = $game_parties[1]
#       :      : $game_party = p
#       :      : $game_player.refresh
#      @>Change Party Member: Add [Oscar], Initialize
#      @>Change Weapons: [Bastard Sword], +1
#      @>Change Gold: + 100
#
#    Assuming that $game_parties[1] did not previously exist, this event just
#    switched your party to the party with index 1, and if you looked at your
#    menu you would see that Oscar is in the party, you have 100 Gold, and a
#    Bastard Sword. The potion and the other 50 Gold went to the initial party
#
#    Now, let's say Oscar later meets up with his party and rejoins. Then this
#    event would do the trick:
#
#      @>Script: $game_parties.merge! (0, 1)
#       :      : $game_party = $game_parties[0]
#       :      : $game_player.refresh
#
#    And there, the two parties have been merged and everything that Oscar had
#    obtained goes to the party.
#==============================================================================

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
#  Summary of Changes:
#    new method - add_multiple_steps
#==============================================================================

class Game_Party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Multiple Steps
  #    amount : the amount of steps to add
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def add_multiple_steps (amount)
    @steps += amount
  end
 
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # Adds a function from VX so the script works in XP
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def items
    result = []
    for i in @items.keys.sort
      result.push($data_items[i]) if @items[i] > 0
    end
    for i in @weapons.keys.sort
      result.push($data_weapons[i]) if @weapons[i] > 0
    end
    for i in @armors.keys.sort
      result.push($data_armors[i]) if @armors[i] > 0
    end
    return result
  end
 
end

#==============================================================================
# ** Game_Parties
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  This class handles Parties. It's a wrapper for the built-in class "Array."
#  It is accessed by $game_parties
#==============================================================================

class Game_Parties
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize
    @data = [$game_party]
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Retrieve Party
  #    id : the ID of the party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def [] (id)
    @data[id] = Game_Party.new if @data[id] == nil
    return @data[id]
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def []= (id, party)
    # Does nothing unless it is a party object
    return unless party.class == Game_Party
    @data[id] = party
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Merge
  #    id_1 : the ID of the first party
  #    id_2 : the ID of the second party
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def merge (id_1, id_2)
    new_party = Game_Party.new
    # Get old parties
    op1 = self[id_1]
    op2 = self[id_2]
    # Gold
    new_party.gain_gold (op1.gold + op2.gold)
    # Members
    (op1.actors | op2.actors).each { |actor| new_party.add_actor (actor.id) }
    # Items, Weapons, and Armor
    (op1.items | op2.items).each { |item|
      new_party.gain_item (item, op1.item_number (item) +  op2.item_number (item))
    }
    # Steps
    new_party.add_multiple_steps (op1.steps + op2.steps)
=begin
    # Not used in RPG Maker Xp
    # Last Item
    new_party.last_item_id = op1.last_item_id
    # Last Actor
    new_party.last_actor_index = op1.last_actor_index
    # Last Target
    new_party.last_target_index = op1.last_target_index
   
    # Quest Log was for Vx not Xp so cut out here.
   
=end
    return new_party
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Merge!
  #    id_1 : the ID of the first party to which the second party is merged
  #    id_2 : the ID of the second party that is deleted
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def merge! (id_1, id_2)
    @data[id_1] = merge (id_1, id_2)
    delete (id_2)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Delete
  #     id : the ID of the quest to be deleted
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def delete (id)
    @data[id] = nil
    # If this was the last in the array
    if id == @data.size - 1
      # Delete any nil elements that exist between this party and its successor
      id -= 1
      while @data[id] == nil
        @data.delete (id)
        id -= 1
      end
    end
  end
end

#==============================================================================
# ** Scene_Title
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased method - create_game_objects
#==============================================================================

class Scene_Title
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Game Objects
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias command_new_game_GP_alias command_new_game
  def command_new_game
    $game_parties      = Game_Parties.new
    command_new_game_GP_alias
  end
end

#==============================================================================
# ** Scene_Save
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods -  write_save_data
#==============================================================================

class Scene_Save

  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Write Save Data
  #     file : write file object (opened)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_multiparty_wrt_sv_dta_6hye write_save_data
  def write_save_data(file)
    modalg_multiparty_wrt_sv_dta_6hye (file)
    Marshal.dump($game_parties,        file)
  end
end

#==============================================================================
# ** Scene_Load
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Summary of Changes:
#    aliased methods - read_save_data
#==============================================================================

class Scene_Load

  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Load Save Data
  #     file : file object for reading (opened)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modalg_multiparty_rd_sv_dat_2gte read_save_data
  def read_save_data(file)
    modalg_multiparty_rd_sv_dat_2gte (file)
    $game_parties        = Marshal.load(file)
  end
end








Instructions
In the script.


Compatibility
In the original script.


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.

7
RMXP Script Database / [XP] Actors name control
July 14, 2011, 02:13:00 pm
Actors name control
Authors: gerrtunk,gerkrt
Version: 1.0
Type: Misc System
Key Term: Misc System



Introduction
This script let you check if actors names have banned words in they.



Features
No extra one.


Screenshots
No.


Demo
No.


Script

Spoiler: ShowHide


#==============================================================================
# Actors name control
# By gerkrt/gerrtunk, Heretic86(Idea)
# Version: 1.0
# License: MIT, credits
# Date: 12/07/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

------INTRODUCTION------

This script let you check if actors names have banned words in they.

-------INSTRUCTIONS---------

Add any new words in Banned_words list, adding a , 'X' each time.
The switch is actived when the scripts call found what where seeking.
Note that yu can use the scripts in a conditions and efects.

is_banned?(actor_id): Call script that check if the actor have a  banned name.
 is_banned?(1) --> check for alexis actor id 1
 
is_word?(actor_id, word): Call script that check if the actors name is the word.
 is_word?(1, 'Wep')  --> check for alexis actor id and the word 'Wep'

Note that this script is case unsesitive.
=end

module Wep
 Banned_words = 'Wep', 'Joan', 'melodic'
 Switch_for_banned = 1
end

class Interpreter

 #--------------------------------------------------------------------------
 # * Is banned?
 #--------------------------------------------------------------------------
 def is_banned?(actor_id)
   for bw in Wep::Banned_words
     if bw.upcase == $game_actors[actor_id].name.upcase
       $game_switches[Wep::Switch_for_banned] = true
       return truerir
     end
   end
   return false
 end
 
 #--------------------------------------------------------------------------
 # * Is word?
 #--------------------------------------------------------------------------
 def is_word?(actor_id, bw)
   if bw.upcase == $game_actors[actor_id].name.upcase
     $game_switches[Wep::Switch_for_banned] = true
     return true
   end
   return false
 end
 
end




Instructions
In the script.


Compatibility
No.


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.
8
Effectivity ratings for skills, defenses and attacks
Authors: gerrtunk,gerkrt
Version: 1.5
Type: Custom Skill System
Key Term: Custom Skill System



Introduction
The original game guys script is a very complete skill shop to improve buying skills in your game.
This is a modified version of the gameguys skill shop. It lets use exp rather than gold for buying, but only for one actor.


Features
Other features explained in original script.



Screenshots
No.


Demo
No.


Script

Spoiler: ShowHide



#===============================================================================
# Skill Shop
# Author: Game_guy, gerkt(exp based addition), mast3rshake2049(idea)
# Date: June 7th, 2009
# Version: 2.2z
# VERY IMPORTANT ADDITION: Edited to use exp and not gold. Only works with one actor in the
# party. The actor have to be the actor with the ID=1 of the database.
#===============================================================================
#
# Intro:
# What this script does is act as a shop but sells skills instead.
#
# Instructions:
# 1: First how do you want it setup? Theres two ways
# 1: -Any person can learn any skill
# or
# 2: -Classes learn different skills then other classes
#
# Go down to UseClasses and set it to false for 1: or true for 2:
#
# 2: Ok now that thats over lets move onto price. Go down to CONFIG PRICE and
# follow the instructions there.
#  
# 3: Skip this step if you set UseClasses to false.
# Go to CONFIG CLASS SKILLS and follow the instructions there.
#
# 4: Ok so everythings setup now. Time to actually find out how to open the
# skillshop right? You use this line
# $scene = SkillShop.new([skill id's go here])
# example
# $scene = SkillShop.new([1, 2]) will make a shop with the skills
# Heal and Great Heal
#
# 5: Ok the script now is able to make it where only skills are learnable at
# certain levels. Go to CONFIG LEVEL and follow instructions there.
#
# 6: Ok so now there's a new option that sorts the skills in the following.
# Alphabetical
# Reverse Alphabetical
# Numeric (Sorts it by Id)
# Reverse Numberic
# Price
# Reverse price
# At default its at numeric but to change it use this,
# $game_system.ssort = 0,1,2, or 3.
# 0 = Numeric, 1 = Reverse Numeric, 2 = Alphabetical,
# 3 = Reverse Alphabetical, 4 = Price, 5 = Reverse Price.
#===============================================================================
module GameGuy
 #==========================
 # BEGIN CONFIG
 #==========================
 UseClasses = true # if false anyone can learn any skill
# if true only classes can learn the defined skills
end
module RPG
 class Skill
def price
 case id
 #==========================
 # CONFIG PRICE
 #==========================
 # use
 # when skill_id then return price
 when 1 then return 50
 when 57 then return 75
 end
 return 10
end
def llevel
 case id
 #==========================
 # CONFIG LEVEL
 #==========================
 # use
 # when skill_id then return level
 when 57 then return 2
 end
 return 1
end
 end
 class Class
def learnskills
 case id
 #==========================
 # CONFIG CLASS SKILLS
 #==========================
 # use
 # when class_id then return [skill id's here]
 when 1 then return [1, 2, 57, 58, 59, 60]
 when 2 then return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 81]
 when 7 then return [69, 70, 71, 72, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80]
 when 8 then return [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56]
 end
 return []
end
 #==========================
 # END CONFIG
 #==========================
 end
end
class Game_System
 attr_accessor :ssort
 alias sort_me_skillz initialize
 def initialize
@ssort = 0
sort_me_skillz
 end
end
class Window_SkillCommand < Window_Selectable
 def initialize
super(0, 64, 480, 64)
self.contents = Bitmap.new(width - 32, height - 32)
@item_max = 2
@column_max = 2
@commands = ["Learn", "Exit"]
refresh
self.index = 0
 end
 def refresh
self.contents.clear
for i in 0...@item_max
 draw_item(i)
end
 end
 def draw_item(index)
x = 4 + index * 240
self.contents.draw_text(x, 0, 128, 32, @commands[index])
 end
end

class Window_SkillBuy < Window_Selectable
 def initialize(shop_goods)
super(0, 128, 368, 352)
@skill_shop_goods = shop_goods
self.active = false
refresh
self.index = 0
 end
 def skill
return @data[self.index]
 end
 def refresh
if self.contents != nil
 self.contents.dispose
 self.contents = nil
end
@data = []
for i in 0...@skill_shop_goods.size
 skill = $data_skills[@skill_shop_goods[i]]
 if skill != nil
@data.push(skill)
 end
end
case $game_system.ssort
when 0
 [@data].each {|ary| ary.sort! {|a, b| a.id <=> b.id}}
when 1
 [@data].each {|ary| ary.sort! {|a, b| a.id <=> b.id}}
 [@data].each {|ary| ary.reverse!}
when 2
 [@data].each {|ary| ary.sort! {|a, b| a.name <=> b.name}}
when 3
 [@data].each {|ary| ary.sort! {|a, b| a.name <=> b.name}}
 [@data].each {|ary| ary.reverse!}
when 4
 [@data].each {|ary| ary.sort! {|a, b| a.price <=> b.price}}
when 5
 [@data].each {|ary| ary.sort! {|a, b| a.price <=> b.price}}
 [@data].each {|ary| ary.reverse!}
else
 [@data].each {|ary| ary.sort! {|a, b| a.id <=> b.id}}
end
@item_max = @data.size
if @item_max > 0
 self.contents = Bitmap.new(width - 32, row_max * 32)
 for i in 0...@item_max
draw_item(i)
 end
end
 end
 def draw_item(index)
skill = @data[index]
price = skill.price
enabled = (price <= $game_actors[1].exp)
if enabled
 self.contents.font.color = normal_color
else
 self.contents.font.color = disabled_color
end
x = 4
y = index * 32
rect = Rect.new(x, y, self.width - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(skill.icon_name)
opacity = self.contents.font.color == normal_color ? 255 : 128
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
self.contents.draw_text(x + 28, y, 212, 32, skill.name, 0)
self.contents.draw_text(x + 240, y, 88, 32, price.to_s, 2)
 end
 def update_help
@help_window.set_text(skill == nil ? "" : skill.description)
 end
end

class Window_SkillStatus2 < Window_Selectable
 def initialize
super(368, 128, 272, 352)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
self.z = 200
self.active = false
self.index = -1
 end
 def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
 x = 64
 y = i * 80
 actor = $game_party.actors[i]
 classs = $data_classes[$game_actors[actor.id].class_id]
 draw_actor_graphic(actor, x - 40, y + 60)
 draw_actor_name(actor, x - 13, y + 10)
 if actor.skill_learn?($thing.id)
self.contents.font.color = crisis_color
$text = "Aquired"
 elsif GameGuy::UseClasses
if classs.learnskills.include?($thing.id) && $thing.llevel <= actor.level
 self.contents.font.color = normal_color
 $text = "Can Learn"
elsif classs.learnskills.include?($thing.id) && $thing.llevel > actor.level
 self.contents.font.color = disabled_color
 $text = "Can Learn At Level " + $thing.llevel.to_s
else
 self.contents.font.color = disabled_color
 $text = "Can't Learn"
end
 else
if actor.level >= $thing.llevel
 self.contents.font.color = normal_color
 $text = "Can Learn"
else
 self.contents.font.color = disabled_color
 $text = "Can Learn At Level " + $thing.llevel.to_s
end
 end
 self.contents.draw_text(x - 13, y + 40, 200, 32, $text)
end
 end
 def update_cursor_rect
if @index < 0
 self.cursor_rect.empty
else
 self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
end
 end
end

class SkillShop
 def initialize(skills)
@skills = skills
 end
 def main
@command = Window_SkillCommand.new
@help_window = Window_Help.new
@skillbuy = Window_SkillBuy.new(@skills)
@skillbuy.active = false
@skillbuy.help_window = @help_window
$thing = @skillbuy.skill
@status = Window_SkillStatus2.new
#@status.visible = false
@gold = Window_Exp.new
@gold.x = 480
@gold.y = 64

Graphics.transition
loop do
 Graphics.update
 Input.update
 update
 if $scene != self
break
 end
end
Graphics.freeze
@gold.dispose
@skillbuy.dispose
@help_window.dispose
@command.dispose
@status.dispose
 end
 def update
@gold.update
@status.update
@gold.refresh
@command.update
@skillbuy.update
@help_window.update
$thing = @skillbuy.skill
@status.refresh
if @command.active
 update_command
 return
end

if @status.active
 update_status
 return
end

if @skillbuy.active
 update_buy
 return
end
 end
 
 def update_buy
if Input.trigger?(Input::B)
 $game_system.se_play($data_system.cancel_se)
 @skillbuy.active = false
 @skillbuy.index = -1
 @command.active = true
 @command.index = 0
 return
end
if Input.trigger?(Input::C)
 $game_system.se_play($data_system.decision_se)
 @skillbuy.active = false
 @status.active = true
 @status.visible = true
 @status.index = 0 if @status.index == -1
end
 end
 
 def update_command
if Input.trigger?(Input::B)
 $game_system.se_play($data_system.cancel_se)
 $scene = Scene_Map.new
 return
end
if Input.trigger?(Input::C)
 $game_system.se_play($data_system.decision_se)
 case @command.index
 when 0
@command.active = false
@command.index = -1
@skillbuy.active = true
@skillbuy.index = 0
 when 1
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
 end
 return
end
 end
 
 def update_status
if Input.trigger?(Input::B)
 @status.active = false
 @status.index = -1
 @skillbuy.active = true
 return
end
if Input.trigger?(Input::C)
 price = @skillbuy.skill.price
 @actort = $game_party.actors[@status.index]
 enabled = (price <= $game_actors[1].exp)
 
 if enabled
if @actort.skill_learn?(@skillbuy.skill.id)
 $game_system.se_play($data_system.buzzer_se)
 return
end
if GameGuy::UseClasses
 if $data_classes[@actort.class_id].learnskills.include?(@skillbuy.skill.id) && @actort.level >= @skillbuy.skill.llevel
@actort.learn_skill(@skillbuy.skill.id)
$game_actors[1].exp -= (@skillbuy.skill.price)
$game_system.se_play($data_system.decision_se)
@status.refresh
@skillbuy.refresh
return
 else
$game_system.se_play($data_system.buzzer_se)
return
 end
else
 if @actort.level >= @skillbuy.skill.llevel
@actort.learn_skill(@skillbuy.skill.id)
$game_actors[1].exp -= (@skillbuy.skill.price)
$game_system.se_play($data_system.decision_se)
@status.refresh
@skillbuy.refresh
 else
$game_system.se_play($data_system.buzzer_se)
return
 end
 return
end

 else
$game_system.se_play($data_system.buzzer_se)
return
 end
end
 end

end

#==============================================================================
# ** Window_Exp
#------------------------------------------------------------------------------
#  This window displays amount of gold.
#==============================================================================

class Window_Exp < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
self.contents.clear
cx = contents.text_size('Exp').width
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, 120-cx-2, 32, $game_actors[1].exp.to_s, 2)
self.contents.font.color = system_color
self.contents.draw_text(124-cx, 0, cx, 32, 'Exp', 2)

 end
end




Instructions
In the script.


Compatibility
Any other enemy troop script.


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.
9
Consume MP in combat by all actions
Authors: gerrtunk,gerkrt
Version: 1.5
Type: Battle Add-on
Key Term: Battle Add-on



Introduction
This script can make that when you execute any actions in combat
your MP is consumed in a system like  Final Fantasy: The Four Heroes
of Light.


Features
Can be configurated in a large number of options (actors, classes, equipment,
skill or item used, fixed value and event variables).


Screenshots
No.


Demo
No.


Script

Spoiler: ShowHide



#==============================================================================
# Consume MP in combat by all actions
# By gerkrt/gerrtunk, sournote103(idea)
# Version: 2.1
# License: GPL, credits
# Date: 16/05/2011
# For the latests updates or bugs fixes of this script check here:
# http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

---------INTRODUCTION----------

This script can make that when you execute any actions in combat
your MP is consumed based in a large number of options (actors, classes, equipment,
skill or item used, fixed value and event variables) like for example in Final Fantasy: The Four Heroes
of Light.

--------INSTRUCTIONS------------

Exist 6 actions with his own identificative code to use:
:attack
:defend
:escape
:skill
:item
:general

General is a general default configurationthats applied always, when you are doing
any action.

You can configure how many and how will be reduced the MP based in these options
that use these codes:

:actors
:classes
:weapons
:shields
:helmets
:armors
:accesories
:variables
:fixed

Plus these two that are used only when using a skill or item:

:skill
:item

In each of these configuration lists, you will put what actor id, or class id,etc
(the id is the value in the database) modify that action and how they do that.
The program sums all the values of the list each time and independently, so you
can have a armor that sums to attack and item, but reduces defense, and does nothing
with the rest, for example, and make other things also.


You dont have to use all of them anyway.

This is a sample configuration, that you have to add anytime you want to configure
any of that options.

id of X(armor, helmet, actor...) => [type(+ or %), value(normal or decimal)],
55 => [2, 0.50],

Each configuration can work in two ways:

If the first value is 1: it will add to the actual sp the value you put
If the value is 2, it will apply a % based changue, so if you write 0.50 for
example it will be reduced to 50% and 1.50 150%.

Note that you can make negative things using negative numbers, but it will never
reduce beyond 0 or 1%.

For configuring you only to have to add each time:
55 => [2, 0.50],
Where 55 is the id of the actor, weapon or armor or whatever, 2 the type to use,
and 0.50 or 50 the value to use.

Note that in :variables the code is different because the value is in the event
variable: 55 => [2], 2 is the type. Also when you are using in % the event
variables its values will be divided by 100, so it became decimals compatible with
the rest. If var 55 was 25, it will be 0.25.

:fixed is different also, it add a value based only on the action and nothing more,
so you dont need the id, but it use the normal way of + or %.
:fixed => [1, 40]

Finally, first is summed the normal value, and later applied the % value. They
way the formula works it sums all the % and normals values before suming nothing.

Also the skill reduces the sp in the normal way first, and later using this script.

----SYNTAX NOTES----
 Actions = {
 
   :attack => { # Attack config
       :weapons => {
         1 => [1, -150],
         2 => [2, 0.50]
       },
       
       :armors => {
         13 => [1, -150],
         2 => [2, 0.50]
       },
       
       :shields => {
         1 => [2, 0.50]
       },
       
       :fixed => [1, 40]
         
   }, # End of attack config
   
To add new option for attack, you have to include it before the last } with the ,
that makrs the end of any action, like defense or item too.

To add a new option like this:

      :helmets => {
         1 => [2, 0.50]
       },
       
       
Do this:
   :attack => { # Attack config
       :weapons => {
         1 => [1, -150],
         2 => [2, 0.50]
       },
       
       :armors => {
         13 => [1, -150],
         2 => [2, 0.50]
       },
       
       :shields => {
         1 => [2, 0.50]
       },
       
      :helmets => {
         1 => [2, 0.50]
       },

       :fixed => [1, 40]
         
   }, # End of attack config
   
So the the option have a , at the end of the {}
To include effects for each id, you have to add a new line each time, adding
a coma at the end. Note that each id have to be unique.

         id,    type, effect
      :helmets => {
         1 => [2, 0.50],
         2 => [2, 0.50],
         3 => [2, 0.50]
       },

=end

module Wep

 Actions = { # Actions start
 
 
   :attack => { # Attack config
       :weapons => {
         1 => [1, -150],
         2 => [2, 0.50]
       },
       
       :armors => {
         13 => [1, -150],
         2 => [2, 0.50]
       },
       
       :shields => {
         1 => [2, 0.50]
       },
       
       :fixed => [1, 40]
         
   }, # End of attack config
   
   :defense => { # Defense config
       :weapons => {
         1 => [1, -150],
         2 => [2, 0.50]
       },
       
       :armors => {
         13 => [1, -150],
         2 => [2, 0.50]
       },
       
       :shields => {
         1 => [2, 0.50]
       },
       
       :actors => {
         1 => [1, -150],
         2 => [2, 0.50]
       },
       
       :classes => {
         1 => [1, -150],
         2 => [2, 0.50]
       },
       
       :variables => {
         1 => [1],
         2 => [2]
       },
       
       :fixed => [1, 40]
         
   },# End of defend config
 
   
   :escape => {# Escape config
         
   },# End of escape config
   
   
   :item => {# Item config
         
   },# End of item config
   
   
   :skill => {# Skill config
         
   },# End of skill config
   
   
   :general => {# General config
       :actors => {
         1 => [2, 1.0],
         2 => [2, 1.50]
       },
       
       :classes => {
         4 => [1, -150],
         2 => [2, 1.50]
       }
         
   },  # End of general config

 } # End of action
 
 
 
 # 6 accions
 # iteres segons el codi,sumant tot, i executant segons el subcodi, i rula be
 # hiperfacil!
 
 
 # fer que lo de accions usi codi dels hashes, hipersimple aleshores
 # tu pases :defend i amb aixo, extreu de un hash de acciones, la bona, i ale
 def self.test(action_type, actor, extra=false)
   v = 0
   r = 0.0
   #actor.sp = 24
   
   # Sum the desired action
   for key, arr  in Actions[action_type] # + Actions[:general]
    #p key, arr
     # Set id of the item or whatever based in key used. Make needed checks.
     if key == :weapons and actor.weapon_id != 0
       id = actor.weapon_id
     elsif key == :shields and actor.armor1_id != 0
       id = actor.armor1_id
     elsif key == :helmets and actor.armor2_id != 0
       id = actor.armor2_id
     elsif key == :armors and actor.armor3_id != 0
       id = actor.armor3_id
     elsif key == :accesories and actor.armor4_id != 0
       id = actor.armor4_id
     elsif key == :actors
       id = actor.actor_id
     elsif key == :classes
       id = actor.class_id
     elsif key == :items
       id = extra
     elsif key == :skills
       id = extra
     elsif key == :fixed
         if arr[0] == 1
            v += arr[1]
         else
            r += arr[1]
         end
         next
     elsif key == :variables
       # If variables, iterate in subarray
       for key2, val in arr
         #p key, val
         if val[0] == 1
           
            v += $game_variables[key2]
            #p 'var v', v
         else
           
            r += ($game_variables[key2].to_f / 100)
            #p 'var r', r, ($game_variables[key2].to_f / 100), key2, $game_variables[key2]
         end
       end
       next
     else
       next
     end
     
     #p arr, id
     # Each time check if value exist and extract it
     if arr[id] != nil
       
         if arr[id][0] == 1
            v += arr[id][1]
         else
            r += arr[id][1]
         end
         #p 'c', v, r
     end

   end
   
   # Sum the general option always
   for key, arr  in Actions[:general]
    #p key, arr
     # Set id of the item or whatever based in key used. Make needed checks.
     if key == :weapons and actor.weapon_id != 0
       id = actor.weapon_id
     elsif key == :shields and actor.armor1_id != 0
       id = actor.armor1_id
     elsif key == :helmets and actor.armor2_id != 0
       id = actor.armor2_id
     elsif key == :armors and actor.armor3_id != 0
       id = actor.armor3_id
     elsif key == :accesories and actor.armor4_id != 0
       id = actor.armor4_id
     elsif key == :actors
       id = actor.actor_id
     elsif key == :classes
       id = actor.class_id
     elsif key == :items
       id = extra
     elsif key == :skills
       id = extra
     elsif key == :variables
       # If variables, iterate in subarray
       for key2, val in arr
         #p key, val
         if val[0] == 1
           
            v += $game_variables[key2]
            #p 'var v', v
         else
           
            r += ($game_variables[key2].to_f / 100)
            #p 'var r', r, ($game_variables[key2].to_f / 100), key2, $game_variables[key2]
         end
       end
       next
     else
       next
     end
     
     #p arr, id
     # Each time check if value exist and extract it
     if arr[id] != nil
       
         if arr[id][0] == 1
            v += arr[id][1]
         else
            r += arr[id][1]
         end
         #p 'c', v, r
     end

   end
   
   #p 'valfin', v, r
   
    # Reduce actor sp
    #p actor.sp
   
    actor.sp= actor.sp + v
    actor.sp= actor.sp * (1.0 + r).to_i
    #actor.sp= actor.sp.to_i
   
    #actor.sp = 9999 if actor.sp > 9999
    #p 'final', actor.sp
    # comprova q r no sigui negatiu
  end
 
       
 
end

class Scene_Battle
 #--------------------------------------------------------------------------
 # * Frame Update (party command phase: escape)
 #--------------------------------------------------------------------------
 def update_phase2_escape
   
   # Calculate enemy agility average
   enemies_agi = 0
   enemies_number = 0
   for enemy in $game_troop.enemies
     if enemy.exist?
       enemies_agi += enemy.agi
       enemies_number += 1
     end
   end
   if enemies_number > 0
     enemies_agi /= enemies_number
   end
   # Calculate actor agility average
   actors_agi = 0
   actors_number = 0
   for actor in $game_party.actors
     if actor.exist?
       actors_agi += actor.agi
       actors_number += 1
       Wep.test (:escape, actor)
     end
   end
   if actors_number > 0
     actors_agi /= actors_number
   end
   # Determine if escape is successful
   success = rand(100) < 50 * actors_agi / enemies_agi
   # If escape is successful
   if success
     # Play escape SE
     $game_system.se_play($data_system.escape_se)
     # Return to BGM before battle started
     $game_system.bgm_play($game_temp.map_bgm)
     # Battle ends
     battle_end(1)
   # If escape is failure
   else
     # Clear all party member actions
     $game_party.clear_actions
     # Start main phase
     start_phase4
   end
 end
 
   #--------------------------------------------------------------------------
 # * Make Basic Action Results
 #--------------------------------------------------------------------------
 def make_basic_action_result
   # If attack
   if @active_battler.current_action.basic == 0
     # Set anaimation ID
     @animation1_id = @active_battler.animation1_id
     @animation2_id = @active_battler.animation2_id
     # If action battler is enemy
     if @active_battler.is_a?(Game_Enemy)
       if @active_battler.restriction == 3
         target = $game_troop.random_target_enemy
       elsif @active_battler.restriction == 2
         target = $game_party.random_target_actor
       else
         index = @active_battler.current_action.target_index
         target = $game_party.smooth_target_actor(index)
       end
     end
     # If action battler is actor
     if @active_battler.is_a?(Game_Actor)
       if @active_battler.restriction == 3
         target = $game_party.random_target_actor
       elsif @active_battler.restriction == 2
         target = $game_troop.random_target_enemy
       else
         index = @active_battler.current_action.target_index
         target = $game_troop.smooth_target_enemy(index)
       end
     end
     # Set array of targeted battlers
     @target_battlers = [target]
     # Apply normal attack results
     for target in @target_battlers
       target.attack_effect(@active_battler)
     end
     return
   end
   # If guard
   if @active_battler.current_action.basic == 1
     # Display "Guard" in help window
     @help_window.set_text($data_system.words.guard, 1)
     # Reduce MP if is a MP consumer and a actor
     if @active_battler.is_a? Game_Actor
          Wep.test (:defense, @active_battler)
     end
   
     
     return
   end
   # If escape
   if @active_battler.is_a?(Game_Enemy) and
      @active_battler.current_action.basic == 2
     # Display "Escape" in help window
     @help_window.set_text("Escape", 1)
     # Escape
     @active_battler.escape
     return
   end
   # If doing nothing
   if @active_battler.current_action.basic == 3
     # Clear battler being forced into action
     $game_temp.forcing_battler = nil
     # Shift to step 1
     @phase4_step = 1
     return
   end
 end
end


class Game_Actor
 attr_reader :actor_id
 attr_reader :class_id
end

class Game_Battler
 
 #--------------------------------------------------------------------------
 # * Applying Normal Attack Effects
 #     attacker : battler
 #--------------------------------------------------------------------------
 def attack_effect(attacker)
   # Clear critical flag
   self.critical = false
     # Reduce MP if is a MP consumer and a actor
     if attacker.is_a? Game_Actor
         Wep.test(:attack, attacker)
     end
   # First hit detection
   hit_result = (rand(100) < attacker.hit)
   # If hit occurs
   if hit_result == true

     # Calculate basic damage
     atk = [attacker.atk - self.pdef / 2, 0].max
     self.damage = atk * (20 + attacker.str) / 20
     # Element correction
     self.damage *= elements_correct(attacker.element_set)
     self.damage /= 100
     # If damage value is strictly positive
     if self.damage > 0
       # Critical correction
       if rand(100) < 4 * attacker.dex / self.agi
         self.damage *= 2
         self.critical = true
       end
       # Guard correction
       if self.guarding?
         self.damage /= 2
       end
     end
     # Dispersion
     if self.damage.abs > 0
       amp = [self.damage.abs * 15 / 100, 1].max
       self.damage += rand(amp+1) + rand(amp+1) - amp
     end
     # Second hit detection
     eva = 8 * self.agi / attacker.dex + self.eva
     hit = self.damage < 0 ? 100 : 100 - eva
     hit = self.cant_evade? ? 100 : hit
     hit_result = (rand(100) < hit)
   end
   # If hit occurs
   if hit_result == true
     # State Removed by Shock
     remove_states_shock
     # Substract damage from HP
     self.hp -= self.damage
     # State change
     @state_changed = false
     states_plus(attacker.plus_state_set)
     states_minus(attacker.minus_state_set)
   # When missing
   else
     # Set damage to "Miss"
     self.damage = "Miss"
     # Clear critical flag
     self.critical = false
   end
   # End Method
   return true
 end
 
 #--------------------------------------------------------------------------
 # * Apply Skill Effects
 #     user  : the one using skills (battler)
 #     skill : skill
 #--------------------------------------------------------------------------
 def skill_effect(user, skill)
   # Clear critical flag
   self.critical = false
     # Reduce MP if is a MP consumer and a actor
     if self.is_a? Game_Actor
          Wep.test(:skill, self, skill)
     end
   # If skill scope is for ally with 1 or more HP, and your own HP = 0,
   # or skill scope is for ally with 0, and your own HP = 1 or more
   if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
      ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
     # End Method
     return false
   end
   # Clear effective flag
   effective = false
   # Set effective flag if common ID is effective
   effective |= skill.common_event_id > 0
   # First hit detection
   hit = skill.hit
   if skill.atk_f > 0
     hit *= user.hit / 100
   end
   hit_result = (rand(100) < hit)
   # Set effective flag if skill is uncertain
   effective |= hit < 100
   # If hit occurs
   if hit_result == true

   
     # Calculate power
     power = skill.power + user.atk * skill.atk_f / 100
     if power > 0
       power -= self.pdef * skill.pdef_f / 200
       power -= self.mdef * skill.mdef_f / 200
       power = [power, 0].max
     end
     # Calculate rate
     rate = 20
     rate += (user.str * skill.str_f / 100)
     rate += (user.dex * skill.dex_f / 100)
     rate += (user.agi * skill.agi_f / 100)
     rate += (user.int * skill.int_f / 100)
     # Calculate basic damage
     self.damage = power * rate / 20
     # Element correction
     self.damage *= elements_correct(skill.element_set)
     self.damage /= 100
     # If damage value is strictly positive
     if self.damage > 0
       # Guard correction
       if self.guarding?
         self.damage /= 2
       end
     end
     # Dispersion
     if skill.variance > 0 and self.damage.abs > 0
       amp = [self.damage.abs * skill.variance / 100, 1].max
       self.damage += rand(amp+1) + rand(amp+1) - amp
     end
     # Second hit detection
     eva = 8 * self.agi / user.dex + self.eva
     hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
     hit = self.cant_evade? ? 100 : hit
     hit_result = (rand(100) < hit)
     # Set effective flag if skill is uncertain
     effective |= hit < 100
   end
   # If hit occurs
   if hit_result == true
     # If physical attack has power other than 0
     if skill.power != 0 and skill.atk_f > 0
       # State Removed by Shock
       remove_states_shock
       # Set to effective flag
       effective = true
     end
     # Substract damage from HP
     last_hp = self.hp
     self.hp -= self.damage
     effective |= self.hp != last_hp
     # State change
     @state_changed = false
     effective |= states_plus(skill.plus_state_set)
     effective |= states_minus(skill.minus_state_set)
     # If power is 0
     if skill.power == 0
       # Set damage to an empty string
       self.damage = ""
       # If state is unchanged
       unless @state_changed
         # Set damage to "Miss"
         self.damage = "Miss"
       end
     end
   # If miss occurs
   else
     # Set damage to "Miss"
     self.damage = "Miss"
   end
   # If not in battle
   unless $game_temp.in_battle
     # Set damage to nil
     self.damage = nil
   end
   # End Method
   return effective
 end

 #--------------------------------------------------------------------------
 # * Application of Item Effects
 #     item : item
 #--------------------------------------------------------------------------
 def item_effect(item)
   # Clear critical flag
   self.critical = false
   Wep.test(:item, self, item)
   # If item scope is for ally with 1 or more HP, and your own HP = 0,
   # or item scope is for ally with 0 HP, and your own HP = 1 or more
   if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or
      ((item.scope == 5 or item.scope == 6) and self.hp >= 1)
     # End Method
     return false
   end
   # Clear effective flag
   effective = false
   # Set effective flag if common ID is effective
   effective |= item.common_event_id > 0
   # Determine hit
   hit_result = (rand(100) < item.hit)
   # Set effective flag is skill is uncertain
   effective |= item.hit < 100
   # If hit occurs
   if hit_result == true
     
     
     # Calculate amount of recovery
     recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp
     recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp
     if recover_hp < 0
       recover_hp += self.pdef * item.pdef_f / 20
       recover_hp += self.mdef * item.mdef_f / 20
       recover_hp = [recover_hp, 0].min
     end
     # Element correction
     recover_hp *= elements_correct(item.element_set)
     recover_hp /= 100
     recover_sp *= elements_correct(item.element_set)
     recover_sp /= 100
     # Dispersion
     if item.variance > 0 and recover_hp.abs > 0
       amp = [recover_hp.abs * item.variance / 100, 1].max
       recover_hp += rand(amp+1) + rand(amp+1) - amp
     end
     if item.variance > 0 and recover_sp.abs > 0
       amp = [recover_sp.abs * item.variance / 100, 1].max
       recover_sp += rand(amp+1) + rand(amp+1) - amp
     end
     # If recovery code is negative
     if recover_hp < 0
       # Guard correction
       if self.guarding?
         recover_hp /= 2
       end
     end
     # Set damage value and reverse HP recovery amount
     self.damage = -recover_hp
     # HP and SP recovery
     last_hp = self.hp
     last_sp = self.sp
     self.hp += recover_hp
     self.sp += recover_sp
     effective |= self.hp != last_hp
     effective |= self.sp != last_sp
     # State change
     @state_changed = false
     effective |= states_plus(item.plus_state_set)
     effective |= states_minus(item.minus_state_set)
     # If parameter value increase is effective
     if item.parameter_type > 0 and item.parameter_points != 0
       # Branch by parameter
       case item.parameter_type
       when 1  # Max HP
         @maxhp_plus += item.parameter_points
       when 2  # Max SP
         @maxsp_plus += item.parameter_points
       when 3  # Strength
         @str_plus += item.parameter_points
       when 4  # Dexterity
         @dex_plus += item.parameter_points
       when 5  # Agility
         @agi_plus += item.parameter_points
       when 6  # Intelligence
         @int_plus += item.parameter_points
       end
       # Set to effective flag
       effective = true
     end
     # If HP recovery rate and recovery amount are 0
     if item.recover_hp_rate == 0 and item.recover_hp == 0
       # Set damage to empty string
       self.damage = ""
       # If SP recovery rate / recovery amount are 0, and parameter increase
       # value is ineffective.
       if item.recover_sp_rate == 0 and item.recover_sp == 0 and
          (item.parameter_type == 0 or item.parameter_points == 0)
         # If state is unchanged
         unless @state_changed
           # Set damage to "Miss"
           self.damage = "Miss"
         end
       end
     end
   # If miss occurs
   else
     # Set damage to "Miss"
     self.damage = "Miss"
   end
   # If not in battle
   unless $game_temp.in_battle
     # Set damage to nil
     self.damage = nil
   end
   # End Method
   return effective
 end
 
end






Instructions
In the script.


Compatibility
Maybe any other addon.


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.
10
Effectivity ratings for skills, defenses and attacks
Authors: gerrtunk,gerkrt
Version: 1.5
Type: Battle Add-on
Key Term: Battle Add-on



Introduction
This script gives a lost option expanded from 2k3, where you could create
elements for equipment that defined it general effectivity in a scale of rates.


Features

Now you can set it for classes also, and for skills too.



Screenshots
No.


Demo

http://www.mediafire.com/?ezvrk0dvh94yz82



Script

Spoiler: ShowHide



Code: text
#==============================================================================
# Effectivity ratings for skills, defenses and attacks
# By gerkrt/gerrtunk
# Version: 1.5
# License: GPL, credits
# Date: 09/07/2011
# For the latests updates or bugs fixes of this script check here:
# http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

---------INTRODUCTION----------

This script gives a lost option expanded from 2k3, where you could create
elements for equipment that defined it general effectivity in a scale of rates.

Now you can set it for classes also, and for skills too.

--------INSTRUCTIONS------------

You have to define two things:
-Group armors, skills... by a name.
 Weapons_groups = {
   
   'Great Axe' => [1, 10],
   'Bow' => [[4,5]]
 }

'Group name' => ['weapon_id1, weapon_id2, etc],


-Make skills, weapons, etc scale ratings.

 Weapons_skills_ratings  = {
   'Great Axe' => [0.10, 0.20],
   'Bow' => [0.20, 0.40, 0.60, 0.80]
 }
 
'Group name' => ['rate for rating1, for 2, etc],

See that you need to add a entry for each group defining the scale ratings,
and the group.

What more you need? You have to define how effictevily the battler will use
the scale. For example, adding entries of that groups in some classes with
the effecitivety value:

 Classes_ratings = {
  1 => {
    'Great Axe' => 1,
    'Bow' => 1
   },
   
  2 => {
    'Mag' => 2
   },
 }
 
Then you have to add to classes ratings or actors ratings the group name with
the rating index value:

'Group name' => rate index,

The rate index number extract the values you store in Weapons_skills_ratings, like if
it used the 'A', 'B', etc, but with numbers. This works in the natural order, but
using a -1 index: it starts with index 0, 1, 2, 3, 4, etc. You can customitze each
scale at your will, in power or number of entries.

In this case, for example, for class 1:
  1 => {
    'Great Axe' => 1, # 0.20
    'Bow' => 1, # 0.40
   },

Then the value in the rating is multiplied with the damage. If there are values
of actor and class, first these two are multiplied, and then with the damage.

This means that a 0.10 is a 10% and a 1.4 a 140%

Note that if you put a invalid index in classes or actors ratings
it will give you a error.

The other things are pretty straightforward from here, they just use the same
methods and vocablury but for others things: skills, defense, actors, etc.

----CONFIGURE THE MODE-------

Set the mode used by the script: 'Both' classes and and actors, 'Only classes'
and 'Only actors'. You have to add that 'words' in that variable:

Use_class_actors = 'Both'

=end




module Wep
 # Set the mode used by the script: 'Both' classes and and actors, 'Only classes'
 # and 'Only actors'.
 Use_class_actors = 'Both'
 
 
 Weapons_groups = {
                   
   'Great Axe' => [1, 10],
   'Bow' => [[4,5]]
 }
 
 Weapons_skills_ratings  = {
   'Great Axe' => [0.10, 0.20],
   'Bow' => [0.20, 0.40, 0.60, 0.80, 1.00, 1.20, 1.40]
 }
 
 Skills_groups = {
                   
   'Mag' => [7],
 }
 
 Skills_skills_ratings  = {
   'Mag' => [0.10, 0.20],
 }
 
 
 Armors_groups = {
                   
   'Base' => [13],
   'Test' => [1]
 }
 
 Armors_skills_ratings  = {
   'Base' => [0.10, 0.20, 0.50],
   'Test'=> [0.10, 0.13, 0.50]
   
 }

 Classes_ratings = {
  1 => {
    'Great Axe' => 1,
    'Bow' => 1,
    'Base' => 2,
    'Mag' => 1,
    'Test' => 1
   }
 
 }
 
  Actors_ratings = {
  1 => {
    'Great Axe' => 0,
    'Bow' => 1,
   }
 
 }
   
end


class Game_Actor

 #--------------------------------------------------------------------------
 # * Attack Rate
 #--------------------------------------------------------------------------  
 def attack_rate
   # Search mark
   encounter = false
   class_val = 0
   actor_val = 0
   val = 0
   
   # Search if equipped weapons have rate
   for key,  value in Wep::Weapons_groups
     if value.include?(self.weapon_id)
       encounter = true
       # Class rate
       if Wep::Classes_ratings[self.class_id] != nil and Wep::Classes_ratings[@class_id][key] != nil
         rate = Wep::Classes_ratings[self.class_id][key]
         #p 'rate', rate
         class_val = Wep::Weapons_skills_ratings[key][rate]
         #p 'classval', class_val
         
       end
       
       if Wep::Actors_ratings[@actor_id] != nil and Wep::Actors_ratings[@actor_id][key] != nil
         # Actor rate
         rate = Wep::Actors_ratings[@actor_id][key]
         actor_val = Wep::Weapons_skills_ratings[key][rate]
       end
     end
   end
   

   # Check mode
   if Wep::Use_class_actors == 'Both'
     if actor_val == 0
       val = class_val
     elsif class_val == 0
       val = actor_val
     else
       val = class_val * actor_val
     end
     #p 'bo', val
   elsif Wep::Use_class_actors == 'Only classes'
     val = class_val
     #p'clas'
   else
     val = actor_val
   end
   
   # Make default if no value used
   val = 1.00 if encounter == false
   #p val, class_val, actor_val
   return val
 end

 #--------------------------------------------------------------------------
 # * Skill Rate
 #--------------------------------------------------------------------------
 def skill_rate(skill_id)
   # Search mark
   encounter = false
   class_val = 0
   actor_val = 0
   val = 0
   
   # Search if equipped weapons have rate
   for key,  value in Wep::Skills_groups
     if value.include?(skill_id)
       #p 'encounter', Wep::Classes_ratings[self.class_id], Wep::Classes_ratings[self.class_id][key]
       encounter = true
       # Class rate
       if Wep::Classes_ratings[self.class_id] != nil and Wep::Classes_ratings[@class_id][key] != nil
         rate = Wep::Classes_ratings[self.class_id][key]
         #p 'rate', rate,Wep::Skills_skills_ratings[key], key
         class_val = Wep::Skills_skills_ratings[key][rate]
         
         #p 'classval', class_val
         
       end
       
       if Wep::Actors_ratings[@actor_id] != nil and Wep::Actors_ratings[@actor_id][key] != nil
         # Actor rate
         rate = Wep::Actors_ratings[@actor_id][key]
         actor_val = Wep::Skills_skills_ratings[key][rate]
       end
     end
   end
   

   # Check mode
   if Wep::Use_class_actors == 'Both'
     if actor_val == 0
       val = class_val
     elsif class_val == 0
       val = actor_val
     else
       val = class_val * actor_val
     end
     #p 'bo', val
   elsif Wep::Use_class_actors == 'Only classes'
     val = class_val
     #p'clas'
   else
     val = actor_val
   end
   
   # Make default if no value used
   val = 1.00 if encounter == false
   #p val, class_val, actor_val
   return val
 end
   
 
 #--------------------------------------------------------------------------
 # * Defend Rate
 #--------------------------------------------------------------------------
 def defend_rate
   # Search mark
   encounter = false
   class_val = 0
   actor_val = 0
   val = 0
   arm_arr = [@armor1_id,@armor2_id,@armor3_id,@armor4_id ]
   
   for arm_id in arm_arr
     # Search if equipped weapons have rate
     for key,  value in Wep::Armors_groups
       if value.include?(arm_id)        
         encounter = true
         # Class rate
         if Wep::Classes_ratings[self.class_id] != nil and Wep::Classes_ratings[self.class_id][key] != nil
           rate = Wep::Classes_ratings[self.class_id][key] and Wep::Classes_ratings[@class_id][key] != nil
           #p 'rate', rate
           class_val += Wep::Armors_skills_ratings[key][rate]
           #p 'classval', class_val
           
         end
         
         if Wep::Actors_ratings[@actor_id] != nil and Wep::Actors_ratings[@actor_id][key] != nil
           # Actor rate
           rate = Wep::Actors_ratings[@actor_id][key]
           #p rate
           actor_val += Wep::Armors_skills_ratings[key][rate]
         end
       end
     end
     
   end
   # Check mode
   if Wep::Use_class_actors == 'Both'
     if actor_val == 0
       val = class_val
     elsif class_val == 0
       val = actor_val
     else
       val = class_val * actor_val
     end
     #p 'both'
   elsif Wep::Use_class_actors == 'Only classes'
     val = class_val
     #p'clas'
   else
     val = actor_val
   end
   
   # Make default if no value used
   val = 1.00 if encounter == false
   #p val, class_val, actor_val
   return val
 end
 
 
 
end


class Game_Battler
 
 #--------------------------------------------------------------------------
 # * Apply Skill Effects
 #     user  : the one using skills (battler)
 #     skill : skill
 #--------------------------------------------------------------------------
 def skill_effect(user, skill)
   # Clear critical flag
   self.critical = false
   # If skill scope is for ally with 1 or more HP, and your own HP = 0,
   # or skill scope is for ally with 0, and your own HP = 1 or more
   if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or
      ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)
     # End Method
     return false
   end
   # Clear effective flag
   effective = false
   # Set effective flag if common ID is effective
   effective |= skill.common_event_id > 0
   # First hit detection
   hit = skill.hit
   if skill.atk_f > 0
     hit *= user.hit / 100
   end
   hit_result = (rand(100) < hit)
   # Set effective flag if skill is uncertain
   effective |= hit < 100
   # If hit occurs
   if hit_result == true
     # Calculate power
     power = skill.power + user.atk * skill.atk_f / 100
     if power > 0
       power -= self.pdef * skill.pdef_f / 200
       power -= self.mdef * skill.mdef_f / 200
       power = [power, 0].max
     end
     # Calculate rate
     rate = 20
     rate += (user.str * skill.str_f / 100)
     rate += (user.dex * skill.dex_f / 100)
     rate += (user.agi * skill.agi_f / 100)
     rate += (user.int * skill.int_f / 100)
     # Calculate basic damage
     self.damage = power * rate / 20
     
     # Rating correction only for actors
     if user.is_a? Game_Actor
      self.damage *= user.skill_rate(skill.id)
      self.damage = self.damage.to_i
     end
     # Rating defensive correction only for actors
     if self.is_a? Game_Actor
      self.damage *= self.defend_rate
      self.damage = self.damage.to_i
     end
   
     # Element correction
     self.damage *= elements_correct(skill.element_set)
     self.damage /= 100
     
     # If damage value is strictly positive
     if self.damage > 0
       # Guard correction
       if self.guarding?
         self.damage /= 2
       end
     end
     # Dispersion
     if skill.variance > 0 and self.damage.abs > 0
       amp = [self.damage.abs * skill.variance / 100, 1].max
       self.damage += rand(amp+1) + rand(amp+1) - amp
     end
     # Second hit detection
     eva = 8 * self.agi / user.dex + self.eva
     hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100
     hit = self.cant_evade? ? 100 : hit
     hit_result = (rand(100) < hit)
     # Set effective flag if skill is uncertain
     effective |= hit < 100
   end
   # If hit occurs
   if hit_result == true
     # If physical attack has power other than 0
     if skill.power != 0 and skill.atk_f > 0
       # State Removed by Shock
       remove_states_shock
       # Set to effective flag
       effective = true
     end
     # Substract damage from HP
     last_hp = self.hp
     self.hp -= self.damage
     effective |= self.hp != last_hp
     # State change
     @state_changed = false
     effective |= states_plus(skill.plus_state_set)
     effective |= states_minus(skill.minus_state_set)
     # If power is 0
     if skill.power == 0
       # Set damage to an empty string
       self.damage = ""
       # If state is unchanged
       unless @state_changed
         # Set damage to "Miss"
         self.damage = "Miss"
       end
     end
   # If miss occurs
   else
     # Set damage to "Miss"
     self.damage = "Miss"
   end
   # If not in battle
   unless $game_temp.in_battle
     # Set damage to nil
     self.damage = nil
   end
   # End Method
   return effective
 end

 #--------------------------------------------------------------------------
 # * Applying Normal Attack Effects
 #     attacker : battler
 #--------------------------------------------------------------------------
 def attack_effect(attacker)
   # Clear critical flag
   self.critical = false
   # First hit detection
   hit_result = (rand(100) < attacker.hit)
   # If hit occurs
   if hit_result == true
     # Calculate basic damage
     atk = [attacker.atk - self.pdef / 2, 0].max
     self.damage = atk * (20 + attacker.str) / 20
     # Rating correction only for actors
     if attacker.is_a? Game_Actor
      self.damage *= attacker.attack_rate
      self.damage = self.damage.to_i
     end
     # Rating defensive correction only for actors
     if self.is_a? Game_Actor
      self.damage *= self.defend_rate
      self.damage = self.damage.to_i
     end
     # Element correction
     self.damage *= elements_correct(attacker.element_set)
     self.damage /= 100
     # If damage value is strictly positive
     if self.damage > 0
       # Critical correction
       if rand(100) < 4 * attacker.dex / self.agi
         self.damage *= 2
         self.critical = true
       end
       # Guard correction
       if self.guarding?
         self.damage /= 2
       end
     end
     # Dispersion
     if self.damage.abs > 0
       amp = [self.damage.abs * 15 / 100, 1].max
       self.damage += rand(amp+1) + rand(amp+1) - amp
     end
     # Second hit detection
     eva = 8 * self.agi / attacker.dex + self.eva
     hit = self.damage < 0 ? 100 : 100 - eva
     hit = self.cant_evade? ? 100 : hit
     hit_result = (rand(100) < hit)
   end
   # If hit occurs
   if hit_result == true
     # State Removed by Shock
     remove_states_shock
     # Substract damage from HP
     self.hp -= self.damage
     # State change
     @state_changed = false
     states_plus(attacker.plus_state_set)
     states_minus(attacker.minus_state_set)
   # When missing
   else
     # Set damage to "Miss"
     self.damage = "Miss"
     # Clear critical flag
     self.critical = false
   end
   # End Method
   return true
 end

 
end





Instructions
In the script.


Compatibility
Any other enemy troop script.


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.
11
RMXP Script Database / [XP] Random enemy parties
July 14, 2011, 10:37:29 am
Random enemy parties
Authors: gerrtunk
Version: 1
Type: Battle Add-on
Key Term: Battle Add-on



Introduction
This script let you use random enemy parties like games like Dragon Quest.


Features

You define a max, min, and the appear rate of each type of enemy in a set of maps, and
the rest is random. You also configure the battlers positions.


Screenshots
No.


Demo
No.


Script

Spoiler: ShowHide
[

#==============================================================================
# Random enemies parties
# By gerkrt/gerrtunk, Heretic86(Idea)
# Version: 1.0
# License: MIT, credits
# Date: 12/07/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

------INTRODUCTION------

This script let you use random enemy parties like games like Dragon Quest. You
define a max, min, and the appear rate of each type of enemy in a set of maps, and
the rest is random.

-------TROOPS EFFECTS---------

The main configuration to do is to add in Random_Enemies hash the troops effects
you need. A troop effect is a seed for a random generation in a set of maps.

 Random_enemies = {
   :troop1 => {
     :maps_ids => [1,2,3],
     # Put this to false if not want confiugre manually, all 50% 1-10
     :enemies_appear => false,
     :defined_positions => false,
     
     :max_enemies => 5,
     :min_enemies => 2,
   }
 }

:maps_ids : a list of maps ids where will have effect, in any other map it wont.
:max_enemies : to control the challengue. the max enemies to create.
:mix_enemies : to control the challengue. the min enemies to create. The number
of enemies is generated randomly with this range.

You have configurated the maps where it happens and the number range, but what
about the enemies types?

To do that you have to add a enemy encounter in a map thats in the maps_ids list,
for example, in the map 2. When that combat starts, the number of enemies will
appear in a random way.

Note that normally all the enemies have the same % to appear in a combat, but you
can changue that using the :enemies_appear option.

:enemies_appear => [[1,3, false,false], [4,5, false, false], [5,8, false, false], ],
Using this, you configure the % of appearance of each enemy, and also some of his
partydefined attributes like immortal(cant dead) and invisible.

[1,3, false,false]
Enemy id, % appear(1 to 10), invisible, immortal. Set false to true to make that
the enemy have these options.

Anyway if just dont need that, make it =>false and they will have the same probabilities.


------ENEMIES POSITIONS---------

As the number of the enemies are random,  you cant use the positions in the
database normally. You can define a set of enemy positions for each troop, in order,
to the max of the rpgmaker thats 8.

You can have some troubles with enemies only using a enemies positions list  
for all of them, thats why each troop can define his own positions.
 
To define the default enemies positions you have to go to troop n1 in the database
and set any up 8 enemies(or the max you will use) in the positions you like.
The scipt will use these in the same order and for all enemies.

To define defined enemies you have to add this line to a troop:
:defined_positions => 4,
instead of false.

Then it will work like the default troop in database, but with troop id=4 this time.
Make the same thing.
 
-------USING THE DEFAULT WAY---------

If you go in a combat that havent defined a troop in this script, that will be loaded
like a normal one, using the database.

------SYNTAX--------------

To add new troop effects just add these each time:


   :troop2 => {
     :maps_ids => [4,5],
     # Put this to false if not want confiugre manually, all 50% 1-10
     :enemies_appear => false,
     :defined_positions => 1,
     
     :max_enemies => 8,
     :min_enemies => 5,
   },
   but updating troopX, to 3, 4, etc.

=end

module Wep
 Random_enemies = {
   :troop1 => {
     :maps_ids => [1,2,3],
     # Put this to false if not want confiugre manually, all 50% 1-10
     :enemies_appear => [[1,3, false,false], [4,5, false, false], [5,8, false, false], ],
     :defined_positions => false,
     
     :max_enemies => 5,
     :min_enemies => 2,
   },
   
   :troop2 => {
     :maps_ids => [4,5],
     # Put this to false if not want confiugre manually, all 50% 1-10
     :enemies_appear => false,
     :defined_positions => 1,
     
     :max_enemies => 8,
     :min_enemies => 5,
   }
 }

 
end




class Game_Enemy
 attr_reader :enemy_id
end

#==============================================================================
# ** Game_Troop
#------------------------------------------------------------------------------
#  This class deals with troops. Refer to "$game_troop" for the instance of
#  this class.
#==============================================================================

class Game_Troop
   
 #--------------------------------------------------------------------------
 # * Setup
 #     troop_id : troop ID
 #--------------------------------------------------------------------------
 def setup(troop_id)
   # Set array of enemies who are set as troops
   @enemies = []
   
   # Initialize roulette
   roulette = []
   enes_appear = []
   
   # Loop
   count = 0
   # Iterate in troops for the one of active map
   for key, value in Wep::Random_enemies
     troop = Wep::Random_enemies[key]
     # Check it
     if troop[:maps_ids].include? $game_map.map_id
       # Save it
       used_troop = troop
       # Iterate in all enemies
       for enemy in $data_troops[troop_id].members
         #p enemy
         # Push the game enemy n times.
         n = 0
         # When default use 5
         if not troop[:enemies_appear]
           n = 5
         else
           enes_appear = troop[:enemies_appear]
          for ene in troop[:enemies_appear]
           
            #p 'ene id ', ene[0], enemy.enemy_id
            if ene[0] == enemy.enemy_id
              n = ene[1]
            end
          end
          # A default value herE?
         end
         #p 'N', n
         n.times do
           roulette.push(enemy.enemy_id) ;# p enemy.enemy_id
   
           
       end

       
     end
     count+=1
     
   end
   #p roulette
   # If roulette size is 0 means that no map have been found for this effect.
   # Then uses the normal way
   if roulette.size == 0
     #p 'normal'
     troop = $data_troops[troop_id]
     for i in 0...troop.members.size
       enemy = $data_enemies[troop.members[i].enemy_id]
       if enemy != nil
         @enemies.push(Game_Enemy.new(troop_id, i))
       end
     end
     
   # The random way
   else
     #p 'rando'
     # Generate enemies
     # Select random enemy until max and starting in min

     val = 0
     
     val = rand(troop[:max_enemies])
     val = troop[:min_enemies] if val < troop[:min_enemies]
     val = troop[:max_enemies] if val > troop[:max_enemies]
     
     count = 0
     for i in 0..val
       #p 'times',i, val, $data_troops
       if used_troop[:defined_positions]
         j = [used_troop[:defined_positions]][0]
         #p 'defined', [used_troop[:defined_positions]][0], i
         x = $data_troops[j].members[count].x
         y = $data_troops[j].members[count].y
       else
         #p 'default'
         x = $data_troops[1].members[count].x
         y = $data_troops[1].members[count].y
       end    
       #x = arr[count][:x]
       #y = arr[count][:y]
       ene = roulette[rand(roulette.size)]
       for eneapp in enes_appear
         if eneapp[0] == ene
           hidd = eneapp[2]
           imm = eneapp[3]
         end
       end
       # Troop_id, member index
       @enemies.push(Game_Enemy.new(troop_id, i, ene, hidd, imm, x, y))
        count +=1
     end
 
   end
 end
end
end

#==============================================================================
# ** Game_Enemy
#------------------------------------------------------------------------------
#  This class handles enemies. It's used within the Game_Troop class
#  ($game_troop).
#==============================================================================

class Game_Enemy < Game_Battler
 #--------------------------------------------------------------------------
 # * Object Initialization
 #     troop_id     : troop ID
 #     member_index : troop member index
 #--------------------------------------------------------------------------
 def initialize(troop_id, member_index, enemy_id, hidden, immortal, x, y)
   super()
   @troop_id = troop_id
   @member_index = member_index
   troop = $data_troops[@troop_id]
   @enemy_id = enemy_id
   enemy = $data_enemies[@enemy_id]
   @battler_name = enemy.battler_name
   @battler_hue = enemy.battler_hue
   @hp = maxhp
   @sp = maxsp
   @x = x
   @y = y
   @hidden = hidden
   @immortal = immortal
 end
   #--------------------------------------------------------------------------
 # * Get Battle Screen X-Coordinate
 #--------------------------------------------------------------------------
 def screen_x
   return @x
 end
 #--------------------------------------------------------------------------
 # * Get Battle Screen Y-Coordinate
 #--------------------------------------------------------------------------
 def screen_y
   return @y
 end
 #--------------------------------------------------------------------------
 # * Get Battle Screen Z-Coordinate
 #--------------------------------------------------------------------------
 def screen_z
   return screen_y
 end
end





Instructions
In the script.


Compatibility
Any other enemy troop script.


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.
12
RPG Maker Scripts / Class changuing new command
January 24, 2011, 06:48:01 pm
Class changuing new command
Version:2
By: gerkrt/gerrtunk

Introduction

This script adds a new command in battle and menu that functions to switch
classes in menu or battle using skills. It also adds a simple class description
window that is shown in the battle and menu.
You can also configure font, vocabulary, and if you want to show sp or not.


Screenshots


Spanish version, testing in Doble Filo game.

Script

Get a more updated one here: http://usuarios.multimania.es/kisap/english_list.html

 
#==============================================================================
# Class changuing new command
# By gerkrt/gerrtunk
# Version: 1.3
# License: MIT, credits
# Date: 22/01/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

-----INTRODUCTION-----

This script adds a new command in battle and menu that functions to switch
classes in menu or battle using skills. It also adds a simple class description
window that is shown in the battle and menu.
You can also configure font, vocabulary, and if you want to show sp or not.

-----INSTRUCTIONS-----

You have to define two basic things:

1- What skills are class changuing skills. To do this you have to modify
this method:

  #--------------------------------------------------------------------------
  # * Class changing skills
  #--------------------------------------------------------------------------
  def self.cambia_clases(skill_id)
    case skill_id
      # If skill id 1--->  Return class 3
      when 1; return 3
      when 6; return 1
      else; return 0
    end
  end

You can add any number of new lines like when 6; return 1. The syntax is:

skill id 1 changue to class 3

when 1; return 3

2- You have to define class descriptions.
  #--------------------------------------------------------------------------
  # * Class descriptions
  #--------------------------------------------------------------------------
  def self.descripcion_clase(class_id)
    case class_id
    # Class id  1---------->  Returns description
    when 3; return "Bonus \n ·Great aglity \n" +
    " ·It consumes less sp" +
     "\n Handicaps \n ·Bad for range attacks"
      else; return "Error. The class dont exist"
    end 
  end

This is somewhat harder. Now the 3 is the class that you are defining and we
are now creating a description for it.

You have to write the bonus and handicaps using two text marks. These marks
tell the script that he is drawing bonus or handicaps so it can use one
or other font color, for example.

The marks are defined in these variables:
  Class_bonus = "Bonus \n"             
  Class_handicaps = " Handicaps \n"       

Then you have to return a text that have class bonus after the bonus mark
and class handicaps after the handicaps mark. So imagine that you want to write:

Bonus
  ·Great aglity
  ·It consumes less sp
Handicaps
  ·Bad for range attacks

You have to write in the return:

when 3; return "Bonus \n ·Great aglity \n" +
" ·It consumes less sp" +
"\n Handicaps \n ·Bad for range attacks"

Also, else; return "Error. The class dont exist" These shows an error message when
the class dont exist.

3- Note that this script dont changue the classes for you. You have to create
a common event for such skills to changue they and add the animation you want or
whatever.

-----OTHER THINGS----

You can control de font size, color and bold for normal, bonus or handicap text.
Set bold to false if you dont want it.

The hard thing to understand is the color. You have to set the values rgb + alpha.
    Handicap_font_color = Color.new(r,g,b,a)
Note that the handicap and bonus fonts are applied to the starting words Bonus
and Handicaps only.

For last, you can set the command name that is the description of the command
you are adding and if you turn off show_sp makig it = false it wont draw
the class changuing skills sp.

------SYNTAX AND TEXT FORMAT NOTES------

-Never erase the else in the methods.
-You must respect the "" for the text
-The spaces are also characters so you can use this to align better your text.
Also the spaces are fixed in the mark workds, so, if you write them or the \n
you will have to respect that.
-The \n character means newline. It will draw the next text in a newline and you
have to write \n for each line.

-Rpg Maker XP sucks for long lines so you have to understand this syntax of the +:
        when 3; return "Bonus \n ·Great aglity \n" +
        " ·It consumes less sp" +
        "\n Handicaps \n ·Bad for range attacks"
The + concatenates two or more phrases so they convert to one. The nice thing
is that also after the + you can create a newline so its more organitzated.

Anyway you can do this like you want. You can also write these lines in a better
editor and jst paste it here.

=end

module Wep
  Command_name = "Special"
  Show_sp = true
  Class_bonus = "Bonus \n"             
  Class_handicaps = " Handicaps \n"     

    # Bonus font
    Bonus_font_bold = true
    Bonus_font_size = 25
    Bonus_font_color = Color.new(192, 224, 255, 255)
    # Handicap font
    Handicap_font_bold = true
    Handicap_font_size = 25
    Handicap_font_color = Color.new(255, 255, 64, 255)
    # Normal font
    Normal_font_bold = false
    Normal_font_size = 25
    Normal_font_color = Color.new(255,255,255,255)

  #--------------------------------------------------------------------------
  # * Class descriptions
  #--------------------------------------------------------------------------
  def self.descripcion_clase(class_id)
    case class_id
    # Class id  1---------->  Returns description
        when 3; return "Bonus \n ·Great aglity \n" +
        " ·It consumes less sp" +
        "\n Handicaps \n ·Bad for range attacks"
        else; return "Error. The class dont exist"
    end 
  end
  #--------------------------------------------------------------------------
  # * Class changing skills
  #--------------------------------------------------------------------------
  def self.cambia_clases(skill_id)
    case skill_id
      # If skill id 1--->  Return class 3
      when 1; return 3
      when 6; return 1
      else; return 0
    end
  end

end

#==============================================================================
# ** Window_OrbeRM
#------------------------------------------------------------------------------
#  Esta ventana muestra los OrbeRM a equipar
#==============================================================================

class Window_OrbeRM < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor : personaje del cual estas examinando sus orbeRM
  #--------------------------------------------------------------------------
  def initialize(actor)
    #     X  Y Amplitud Altura respectivamente. Valores para el menu principal.
    super(0, 64, 270, 416)
    @actor = actor
    @column_max = 1
    refresh
    $scene.activar_descripcion(Wep.cambia_clases(skill.id))
    self.index = 0
    # Si esta en la batalla modifica la posicion, tamaño y transparencia.
    if $game_temp.in_battle
      # La mueve hacia arriva del todo.
      self.y = 0
      # Reduce su altura
      self.height = 320
      # Cambia la transparencia del fondo
      self.back_opacity = 160
    end
  end

  #--------------------------------------------------------------------------
  # * Acquiring Skill
  #--------------------------------------------------------------------------
  def skill
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Modifica la id de la clase a describir en la ventana de descripcion
    $scene.activar_descripcion(Wep.cambia_clases(skill.id))
   
    # If cursor is movable
    if self.active and @item_max > 0 and @index >= 0
      # If pressing down on the directional buttons
      if Input.repeat?(Input::DOWN)
        # If column count is 1 and directional button was pressed down with no
        # repeat, or if cursor position is more to the front than
        # (item count - column count)
        if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
           @index < @item_max - @column_max
          # Move cursor down
          $game_system.se_play($data_system.cursor_se)
          @index = (@index + @column_max) % @item_max
          $scene.refrescar_descripcion
        end
      end
      # If the up directional button was pressed
      if Input.repeat?(Input::UP)
        # If column count is 1 and directional button was pressed up with no
        # repeat, or if cursor position is more to the back than column count
        if (@column_max == 1 and Input.trigger?(Input::UP)) or
           @index >= @column_max
          # Move cursor up
          $game_system.se_play($data_system.cursor_se)
          @index = (@index - @column_max + @item_max) % @item_max
          # Refresca ventana para dibujar una unica vez la descripcion
          $scene.refrescar_descripcion
        end
      end
      # If the right directional button was pressed
      if Input.repeat?(Input::RIGHT)
        # If column count is 2 or more, and cursor position is closer to front
        # than (item count -1)
        if @column_max >= 2 and @index < @item_max - 1
          # Move cursor right
          $game_system.se_play($data_system.cursor_se)
          @index += 1
          # Refresca ventana para dibujar una unica vez la descripcion
          $scene.refrescar_descripcion
        end
      end
      # If the left directional button was pressed
      if Input.repeat?(Input::LEFT)
        # If column count is 2 or more, and cursor position is more back than 0
        if @column_max >= 2 and @index > 0
          # Move cursor left
          $game_system.se_play($data_system.cursor_se)
          @index -= 1
          # Refresca ventana para dibujar una unica vez la descripcion
          $scene.refrescar_descripcion
        end
      end
      # If R button was pressed
      if Input.repeat?(Input::R)
        # If bottom row being displayed is more to front than bottom data row
        if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
          # Move cursor 1 page back
          $game_system.se_play($data_system.cursor_se)
          @index = [@index + self.page_item_max, @item_max - 1].min
          self.top_row += self.page_row_max
          # Refresca ventana para dibujar una unica vez la descripcion
          $scene.refrescar_descripcion
        end
      end
      # If L button was pressed
      if Input.repeat?(Input::L)
        # If top row being displayed is more to back than 0
        if self.top_row > 0
          # Move cursor 1 page forward
          $game_system.se_play($data_system.cursor_se)
          @index = [@index - self.page_item_max, 0].max
          self.top_row -= self.page_row_max
          # Refresca ventana para dibujar una unica vez la descripcion
          $scene.refrescar_descripcion
        end
      end
    end
    # Update cursor rectangle
    update_cursor_rect
  end

  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
       # Comprueva si la habilidad es cambia-clases
          class_id = Wep.cambia_clases(skill.id)
            if class_id != 0
              if skill != nil
               # Si lo es la añade al array de orbesRM
               @data.push(skill)
              end
            end
    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     index : item number
  #--------------------------------------------------------------------------
  def draw_item(index)
    skill = @data[index]
    if @actor.skill_can_use?(skill.id)
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(skill.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0)
    self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2) if Wep::Show_sp

  end
end

#==============================================================================
# ** Window_DescripcionClase
#------------------------------------------------------------------------------
#  Esta ventana muestra informacion sobre la clase (OrbeRM)
#==============================================================================
class Window_DescripcionClase < Window_Base
  attr_accessor :class_id
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    #     X   Y  Amplitud Altura respectivamente. Valores para el menu principal.
    super(270, 64, 370, 416)
    self.contents = Bitmap.new(width-32, height-32)
    @class_id
    @s1 = Wep::Class_bonus             # Palabra para la linea de ventajas
    @s2 = Wep::Class_handicaps        # Palabra para la liea de desventajas
    # Cuidado. El programa buscara exactamente la palabra que escribas.
    # Esto incluye tanto espacios en blanco o el mismo caracter de saltar linea \n
    self.z = 254
    # Si esta en la batalla modifica la posicion, tamaño y transparencia.
    if $game_temp.in_battle
      # La situa arriva del todo
      self.y = 0
      # Reduce su altura
      self.height = 320
      # Cambia la transparencia del fondo
      self.back_opacity = 160
    end
  end

  #--------------------------------------------------------------------------
  # * comprovar_linea ( Comprueva si la linea es alguno de las palabras
  #   definidas y cambia su estilo.)
  #--------------------------------------------------------------------------
  def comprovar_linea(linea)
      # Si son bonificaciones
      if linea == @s1
            # Cambia los atributos de la fuente
            self.contents.font.bold = Wep::Bonus_font_bold
            self.contents.font.size = Wep::Bonus_font_size
            self.contents.font.color = Wep::Bonus_font_color
      # Si son handicaps
      elsif linea == @s2
            # Cambia los atributos de la fuente
            self.contents.font.bold = Wep::Handicap_font_bold
            self.contents.font.size = Wep::Handicap_font_size
            self.contents.font.color = Wep::Handicap_font_color
            # Si no se esta en batalla suma +2 al indice para dejar espacio entre los bloques
            if not $game_temp.in_battle
              @i+=2
            end
      # Si se ha cambiado algun atributo de la fuente
      elsif self.contents.font.bold != false or self.contents.font.color != normal_color or self.contents.font.size !=  Font.default_size
           # Revierte los cambios en la fuente para dibujarla normal
            self.contents.font.bold = Wep::Normal_font_bold
            self.contents.font.size = Wep::Normal_font_size
            self.contents.font.color = Wep::Normal_font_color
      end
    end
   
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    descripcion = Wep.descripcion_clase(@class_id)
    @i = 0
    # Dibuja las lineas segun el algoritmo
    descripcion.each_line {|linea| comprovar_linea(linea) ;  self.contents.draw_text(0, 32*@i, self.contents.width, 32, linea) ;@i+=1 }
  end
end

#==============================================================================
# ** Scene_Skill
#------------------------------------------------------------------------------
#  This class performs skill screen processing.
#==============================================================================

class Scene_OrbeRM
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_index : actor index
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Get actor
    @actor = $game_party.actors[@actor_index]
    # Crea ventana de descripcion
    @ventana_descripcion = Window_DescripcionClase.new
    # Make help window, status window, and skill window
    #@help_window = Window_Help.new
    @status_window = Window_SkillStatus.new(@actor)
    @status_window.y = 0
    @skill_window = Window_OrbeRM.new(@actor)
    @ventana_descripcion.refresh
    # Associate help window
    #@skill_window.help_window = @help_window
    # Make target window (set to invisible / inactive)
    @target_window = Window_Target.new
    @target_window.visible = false
    @target_window.active = false
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    #@help_window.dispose
    @status_window.dispose
    @skill_window.dispose
    @target_window.dispose
    @ventana_descripcion.dispose
  end
  #--------------------------------------------------------------------------
  # * Refrescar ventana descripcion optimizada
  #--------------------------------------------------------------------------
  def refrescar_descripcion
    @ventana_descripcion.refresh
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    #@help_window.update
    @status_window.update
    @skill_window.update
    @target_window.update
    # Si la ventana de descripcion esta visible, actualizarla.
    if @ventana_descripcion.visible
      @ventana_descripcion.update
    end
    # If skill window is active: call update_skill
    if @skill_window.active
      update_skill
      return
    end
    # If skill target is active: call update_target
    if @target_window.active
      update_target
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (if skill window is active)
  #--------------------------------------------------------------------------
  def update_skill
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(1)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the skill window
      @skill = @skill_window.skill
      # If unable to use
      if @skill == nil or not @actor.skill_can_use?(@skill.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # If effect scope is ally
      if @skill.scope >= 3
        # Activate target window
        @skill_window.active = false
        @target_window.x = (@skill_window.index + 1) % 2 * 304
        @target_window.visible = true
        @target_window.active = true
        # Set cursor position to effect scope (single / all)
        if @skill.scope == 4 || @skill.scope == 6
          @target_window.index = -1
        elsif @skill.scope == 7
          @target_window.index = @actor_index - 10
        else
          @target_window.index = 0
        end
      # If effect scope is other than ally
      else
        # If common event ID is valid
        if @skill.common_event_id > 0
          # Common event call reservation
          $game_temp.common_event_id = @skill.common_event_id
          # Play use skill SE
          $game_system.se_play(@skill.menu_se)
          # Use up SP
          @actor.sp -= @skill.sp_cost
          # Remake each window content
          @status_window.refresh
          @skill_window.refresh
          @target_window.refresh
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
    # If R button was pressed
    if Input.trigger?(Input::R)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To next actor
      @actor_index += 1
      @actor_index %= $game_party.actors.size
      # Switch to different skill screen
      $scene = Scene_Skill.new(@actor_index)
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::L)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # To previous actor
      @actor_index += $game_party.actors.size - 1
      @actor_index %= $game_party.actors.size
      # Switch to different skill screen
      $scene = Scene_Skill.new(@actor_index)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Activar descripcion
  # Modifica la id de la clase a describir en la ventana de descripcion
  #--------------------------------------------------------------------------
  def activar_descripcion(class_id)
    @ventana_descripcion.class_id = class_id
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when target window is active)
  #--------------------------------------------------------------------------
  def update_target
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Erase target window
      @skill_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If unable to use because SP ran out
      unless @actor.skill_can_use?(@skill.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # If target is all
      if @target_window.index == -1
        # Apply skill use effects to entire party
        used = false
        for i in $game_party.actors
          used |= i.skill_effect(@actor, @skill)
        end
      end
      # If target is user
      if @target_window.index <= -2
        # Apply skill use effects to target actor
        target = $game_party.actors[@target_window.index + 10]
        used = target.skill_effect(@actor, @skill)
      end
      # If single target
      if @target_window.index >= 0
        # Apply skill use effects to target actor
        target = $game_party.actors[@target_window.index]
        used = target.skill_effect(@actor, @skill)
      end
      # If skill was used
      if used
        # Play skill use SE
        $game_system.se_play(@skill.menu_se)
        # Use up SP
        @actor.sp -= @skill.sp_cost
        # Remake each window content
        @status_window.refresh
        @skill_window.refresh
        @target_window.refresh
        # If entire party is dead
        if $game_party.all_dead?
          # Switch to game over screen
          $scene = Scene_Gameover.new
          return
        end
        # If command event ID is valid
        if @skill.common_event_id > 0
          # Command event call reservation
          $game_temp.common_event_id = @skill.common_event_id
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      # If skill wasn't used
      unless used
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end
end

#==============================================================================
# ** Scene_Battle (part 3)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle

  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase)
  #--------------------------------------------------------------------------
  def update_phase3
    # If enemy arrow is enabled
    if @enemy_arrow != nil
      update_phase3_enemy_select
    # If actor arrow is enabled
    elsif @actor_arrow != nil
      update_phase3_actor_select
    # If skill window is enabled
    elsif @skill_window != nil
      update_phase3_skill_select
    # If orbeRM window is enabled
    elsif @orberm_window != nil
      update_phase3_orberm_select
    # If item window is enabled
    elsif @item_window != nil
      update_phase3_item_select
    # If actor command window is enabled
    elsif @actor_command_window.active
      update_phase3_basic_command
    end
  end

  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : orbeRM selection)
  #--------------------------------------------------------------------------
  def update_phase3_orberm_select
    # Make OrbeRM window visible
    @orberm_window.visible = true
    # Update OrbeRM window
    @orberm_window.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End skill selection
      end_orberm_select
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Get currently selected data on the orbeRM window
      @orberm = @orberm_window.skill
      # If it can't be used
      if @orberm == nil or not @active_battler.skill_can_use?(@orberm.id)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action            ##################################33333 IMP !!!!!
      @active_battler.current_action.skill_id = @orberm.id
      # Make skill window invisible
      @orberm_window.visible = false
      # If effect scope is single enemy
      if @orberm.scope == 1
        # Start enemy selection
        start_enemy_select
      # If effect scope is single ally
      elsif @orberm.scope == 3 or @orberm.scope == 5
        # Start actor selection
        start_actor_select
      # If effect scope is not single
      else
        # End skill selection
        end_orberm_select
        # Go to command input for next actor
        phase3_next_actor
      end
      return
    end
  end

  #--------------------------------------------------------------------------
  # * Start OrbeRM Selection
  #--------------------------------------------------------------------------
  def start_orberm_select
    # Crea ventana de descripcion
    @ventana_descripcion = Window_DescripcionClase.new
    # Make OrbeRM window
    @orberm_window = Window_OrbeRM.new(@active_battler)
    refrescar_descripcion
    # Desactiva temporalmente ventana de ayuda
    @help_window.visible = false
    # Disable actor command window
    @actor_command_window.active = false
    @actor_command_window.visible = false
  end
  #--------------------------------------------------------------------------
  # * End OrbeRM selection
  #--------------------------------------------------------------------------
  def end_orberm_select
    # Dispose of orbeRM window
    @orberm_window.dispose
    @ventana_descripcion.dispose
    @orberm_window = nil
    @ventana_descripcion = nil
    # Hide help window
    @help_window.visible = false
    # Enable actor command window
    @actor_command_window.active = true
    @actor_command_window.visible = true
  end
end

#==============================================================================
# ** Scene_Battle (part 1)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Initialize each kind of temporary battle data
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # Initialize battle event interpreter
    $game_system.battle_interpreter.setup(nil, 0)
    # Prepare troop
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # Make actor command window
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = Wep::Command_name
    s4 = $data_system.words.guard
    s5 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4, s5])
    @actor_command_window.y = 128
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # Make other windows
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    @status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
    # Crea ventana de descripcion
    # @ventana_descripcion = Window_DescripcionClase.new(x=320, y=128, amplitud=320, altura=352)
    # @ventana_descripcion.visible = false
    # Make sprite set
    @spriteset = Spriteset_Battle.new
    # Initialize wait count
    @wait_count = 0
    # Execute transition
    if $data_system.battle_transition == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
        $data_system.battle_transition)
    end
    # Start pre-battle phase
    start_phase1
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Refresh map
    $game_map.refresh
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @actor_command_window.dispose
    @party_command_window.dispose
    @help_window.dispose
    @status_window.dispose
    @message_window.dispose
    if @skill_window != nil
      @skill_window.dispose
    end
    if @orberm_window != nil
      @orberm.dispose
    end
    if @ventana_descripcion != nil
      @ventana_descripcion.dispose
    end
    if @item_window != nil
      @item_window.dispose
    end
    if @result_window != nil
      @result_window.dispose
    end
    # Dispose of sprite set
    @spriteset.dispose
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
    # If switching from battle test to any screen other than game over screen
    if $BTEST and not $scene.is_a?(Scene_Gameover)
      $scene = nil
    end
  end

  #--------------------------------------------------------------------------
  # * Activar descripcion
  # Modifica la id de la clase a describir en la ventana de descripcion
  #--------------------------------------------------------------------------
  def activar_descripcion(class_id)
    @ventana_descripcion.class_id = class_id
  end
  #--------------------------------------------------------------------------
  # * Refrescar ventana descripcion optimizada
  #--------------------------------------------------------------------------
  def refrescar_descripcion
    @ventana_descripcion.refresh
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # If battle event is running
    if $game_system.battle_interpreter.running?
      # Update interpreter
      $game_system.battle_interpreter.update
      # If a battler which is forcing actions doesn't exist
      if $game_temp.forcing_battler == nil
        # If battle event has finished running
        unless $game_system.battle_interpreter.running?
          # Rerun battle event set up if battle continues
          unless judge
            setup_battle_event
          end
        end
        # If not after battle phase
        if @phase != 5
          # Refresh status window
          @status_window.refresh
        end
      end
    end
    # Update system (timer) and screen
    $game_system.update
    $game_screen.update
    # If timer has reached 0
    if $game_system.timer_working and $game_system.timer == 0
      # Abort battle
      $game_temp.battle_abort = true
    end
    # Update windows
    @help_window.update
    @party_command_window.update
    @actor_command_window.update
    @status_window.update
    @message_window.update
    if @ventana_descripcion != nil
      @ventana_descripcion.update
    end
    # Update sprite set
    @spriteset.update
    # If transition is processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
          $game_temp.transition_name)
      end
    end
    # If message window is showing
    if $game_temp.message_window_showing
      return
    end
    # If effect is showing
    if @spriteset.effect?
      return
    end
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      $scene = Scene_Gameover.new
      return
    end
    # If returning to title screen
    if $game_temp.to_title
      # Switch to title screen
      $scene = Scene_Title.new
      return
    end
    # If battle is aborted
    if $game_temp.battle_abort
      # Return to BGM used before battle started
      $game_system.bgm_play($game_temp.map_bgm)
      # Battle ends
      battle_end(1)
      return
    end
    # If waiting
    if @wait_count > 0
      # Decrease wait count
      @wait_count -= 1
      return
    end
    # If battler forcing an action doesn't exist,
    # and battle event is running
    if $game_temp.forcing_battler == nil and
       $game_system.battle_interpreter.running?
      return
    end
    # Branch according to phase
    case @phase
    when 1  # pre-battle phase
      update_phase1
    when 2  # party command phase
      update_phase2
    when 3  # actor command phase
      update_phase3
    when 4  # main phase
      update_phase4
    when 5  # after battle phase
      update_phase5
    end
  end
end

#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
#  This window displays usable skills on the skill and battle screens.
#==============================================================================

class Window_Skill < Window_Selectable

  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
       # Comprueva que la habilidad no sea cambia-clases
          class_id = Wep.cambia_clases(skill.id)
            if class_id == 0
              # Añade las habilidades no cambia-clases
                if skill != nil
                  @data.push(skill)
                end
            end

    end
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
end

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================
class Scene_Menu
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = Wep::Command_name
    s6 = "Save"
    s7 = "Exit"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(5)
    end
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 256
    # Make steps window
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 352
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 4
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # newCommand
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 5  # save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
      when 6  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 1  # skill
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      when 4  # newCommand
        # If this actor's action limit is 2 or more
        if $game_party.actors[@status_window.index].restriction >= 2
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Canvia a la escena de OrbeRM
        $scene = Scene_OrbeRM.new(@status_window.index)
      return
      end   
    end
  end
end

#==============================================================================
# ** Window_Steps
#------------------------------------------------------------------------------
#  This window displays step count on the menu screen.
#==============================================================================

class Window_Steps < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
end



Instructions

Nothing special. Just insert it before main.

Authors notes

All my scripts are in development and im open to suggestions, critics,  bugs, etc.

13
RPG Maker Scripts / RGSS HTML Document(scripters tool)
January 24, 2011, 06:38:38 pm
RGSS  HTML Docuement
Version:1
By: gerkrt/gerrtunk

Introduction


This object represents a html page in memory. You can open it, write, format
and finally save to a file.

You only can write to the document throught the write methods, but you
have a plenty of them, and a few shortcuts and automtism.

For last, the html code is in a single string called contents, that can
only be readed. The save in a html file is done at the end, calling a closing
method.


Screenshots

Not needed

Script

Get a more updated one here: http://usuarios.multimania.es/kisap/english_list.html


#==============================================================================
# RGSS HTML DOCUMENT
# By gerkrt/gerrtunk
# Version: 1
# License: MIT, credits
# Date: 24/01/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================


=begin


####################
#RGSS HTML DOCUMENT#
####################

This object represents a html page in memory. You can open it, write, format
and finally save to a file.

You only can write to the document throught the write methods, but you
have a plenty of them, and a few shortcuts and automtism.

For last, the html code is in a single string called contents, that can
only be readed. The save in a html file is done at the end, calling a closing
method.

###################
#####EXAMPLE#######
###################

doc = HtmlDoc.new 'log', 'Title: You can set title through constructor also', 'black'
doc.b=true
doc.wH 'Combat against King Limo', 1
doc.b=false
doc.wTable ''
doc.size=8
doc.wP 'textoooooooooooooooooooooooooo', 'center'
doc.tForm 'b,c,44,#red,Arial',4
doc.wLine 'Testing line'
doc.wBr
doc.wBr
doc.wList ['wep', 'wea', 'yu']#, type='ul', style='square'
doc.wBr 15
doc.wList [['wep', 'm'], ['wep','wea']], type='dl' #style='square'

doc.wImg 'wep.png', 'width=18 height= 22 border=5'
doc.wLink 'www.google.es', 'test'
doc.Form 'u,@blue'

doc.EndSave

####################
#COMPLETE REFERENCE#
####################


CREATING A NEW HTMLDOC OBJECT

The constructor needs the html filename (accepts path, but it puts
automatically the extension .html when saving it), and accepts two extra
parameters:

Note thats recommended to use all the arguments except the charset. The other
way is more complex and slow.

title: you can pass the title of the HTML page. If you do, it will be called
the wHead method and it will asigned automatically

bgcolor: in the same way, you can set the bgcolor of the body here. This
will call the wBody method.

charset: for default it is utf8, but you can changue it.

Note that if you pass these two arguments, the creation of the starting part
of the document is more quick.


ATRIBUTES

You can set or get any of these atributes:

(text atributes in html)
-b
-u
-s

(font atributes in html)
-size
-name
-color

(background colors for page or other things in html)
-bgcolor

(the file where it will be sav ed)
-filename

You can also read the string contents, that have all the html code.

FORMATING

This object writes formated code using his owns previsously named atributes as
a marks. So, if you have the b atribute to true, it will write [b] [/b] each
time you write a text. It also writes all the font information that is font name,
color and size.

The way for formating a htmldoc is to changue these values each time you need
to modifiy the text format. But, for this task you have two options:

  A. You can use the atributes way, and just modifiy each time setting they.
 
  B. You can use the format method(Form) that interprets a string to changue the
  state of the format atributes. So, for example if you call:
 
  doc.Form 'b,c,13,#red,Arial'
 
  You are changuing all these atributes. The b, c, u, etc work in a mechanism way,
  so if its true it will be false, and if false, it will be true. The number is
  for the font size.
 
  Note that font colors use the special code # to mark them and bg colors use @
 
TEMPORAL FORMATING

Using this method(tFom) you can changue any atributes temporally, so that
they only will be aplied to the next x write methods(default=1). Note that
the methods endhtml, save, saveend, wLn, format and tformat dont reduce
the count.

doc.tForm 'b c 13 #red Arial', 3

GENERAL WRITE METHODS

These are. They are abreviated like wX

wLine: Writes a string of text and appends a final <br>

wH: Writes a formated header. Accepts a string name and a addiotional integer value 1-6. Note
that font size formating is skiped here. Default=2.

wTxt: Writes a formated string of text.

wList: Writes a list based on a given array. The natural is a string array,
but it forces the to_s of the object so if you have these implemented, it will
work.

You can pass two extra parameters:

type: 'dl', 'ul', 'ol' for each of the posible html lists. Default is ul.

style: 'square' or 'i'(and others) for each of the posible graphics for the lists. Default are
1, circle.

Note that for dl you have to pass a array of two elements arrays, like:
[[1, 'wep'], ['test', 'fooop']]

wBr: writes a single <BR>. You can also set and extra numeric argument so
it writes all that BR's.

wHr: Like the Wbr, but with <hr>

wTable(info, border=5, param='', names='', bold=true):
This method can write a table showing the values of of a rgss table with
two dimensions. Table writing is the more complex thing of these script. It haves
these parameters

  border: by default 5, it adds the atribute border width 5 to the table

  param: this is a string that may contain any extra atributes for the table, the
  text is concatenated just before the border atribute.

  names: this is a string that defines the columns names in the table.
    names = 'a,b,c,ddddd '
    The string is splitted by , and applied in order to the columns
    col1 = 'a' col2 = 'b' col3 = 'c', etc

  bold: this boolean sets the font of the names list to bold, so it looks better.

wP(text, align): You can write a new paragraph with setting the alignement
for it. The default align is left.

wLink(link, description): Writes a html link with optional description text.
If not passed, description is the link dir.

wImg(img, width, height): Writes a image, and also you can set optionally
the width and height. Default values are 100

STARTING METHODS

wHead(title): This method  writes all the header. You have to pass
a optional string for the title of the page. The default is ''

wBody(bgcolor): This starts the body, fixing the bgcolor. If not bgcolor
is passed, it will use the atribute defined one.

Note that is better to not use this methods and send this options in the
constructor.

ENDING AND SAVING METHODS

endSave: Use this method if you just want to end a html document and save
it directly to the file. No other uses for it.

wEnd: This writes the ending of html, but it dont save it.

saveDoc: This save the document to the specified file.

OTHER METHODS

wNl: Used internally for the program. A abbreviation to append \n in some parts.
redCount: This method is called at the end of some methods and it checks and reduces
the temporal formating count.

SHORTED METHODS

wLine, wTxt and wCode have shortened methods that work like
the same:

wL : wLine
wT : WTxt
wC : wCode

NON FORMATED TEXT AND EXTRA CODE

If you want to show a non formated text, or a add a completely yours thing
to the code, or make any other special thing, you have to use the write code
method(wCode)

This dont add any extra code to the string you pass, so its a clean way of adding
some things to the contents.

PASSING EXTRA ATRIBUTES TO HTML TAGS (param string)

You know that in html for example you can define the widht and height of a picture
or the border.

You can pass to some wMethods a extra parameter called param. This
string is addedd after the start of the html tag, so per example:

doc.wImg 'wep.png', 'width=18 height= 22 border=5'

Will result in the code :

<img src=wep.png width=18 height= 22 border=5>

Note that not all of the methods accept this. Its been implemented in
that have interesting html tags for the purpose of the script. They are:

wImg

Finally, the more common functions are passed as single arguments, thought you
can pass like this if you want. They are passed as signle arguments because
they are quicker to write.


ADDING SPECIAL FORMATINGS

The way of adding extra formating is calling wTxt sending the text with
the special html tags. Example:

doc.wTxt [sub] example text [/sub]



DocProp = Struct.new(:name, :b, :c, :size, :u, :color)

=end

# pots ferla sense escriurels obligt,re, si pases marc no els fa

TableNeedParam = Exception.new('La tabla que va a escri')

#==============================================================================
# ** HtmlDoc
#------------------------------------------------------------------------------
#  This represents a Html Document in RGSS
#==============================================================================

class HtmlDoc
   
  attr_accessor  :b
  attr_accessor  :size
  attr_accessor  :filename
 
  attr_reader    :contents
 
 
  # format o altre
  # pots setejar automatic el head pasan titul, tb boy pasant color,
  # o ferlos a ma si vols
 
  # factorai a table?
 
 
  # MOLA aket y saveEnd
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(filename, title='', bgcolor='', charset='utf-8')
    @filename = filename    # The name of the file. Is added +.txt later
    @contents = ""          # String that contain all the html contents
    @form_count = 0         # The counter used for temporal formating
    @count_active = false   # Mark used by the temporal formating
    @temporal_codes = ''    # This is used to save the reverse codes for temporalformating
   
    # HTML and font atributes and their default values
    @name = 'Arial'
    @b = false
    @u = false
    @c = false
    @size = '8'
    @color = 'black'
    @bgcolor = 'blue'
   
    # Write title if passed
    if title
      wHead(title)
    end
   
    # Write bgcolor if passed
    if bgcolor
      @bgcolor = bgcolor
      wBody
    end
   
    # Write charset
    if charset
      "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=#{charset}\" \n"
    end
 
  #--------------------------------------------------------------------------
  # * wTable
  #--------------------------------------------------------------------------
  def wTable (info, border=5, param='', names='', bold=true)

    @contents+="<table border= #{border.to_s} #{param.to_s}>"
   
    # When is a rgss table(x,y)
    if info.is_a? Table
     
      if names
       
        splitted = names.split(',')
       
        dont_remove_bold = false
       
        if bold and not @b
          @b = true
        elsif bold and @b
          dont_remove_bold = true
        end
       
        @contents+='<tr>'
        for j in 0...info.ysize
          @contents+='<td>'
          wTxt splitted[j], false
          @contents+='</td>'
        end
       
        if bold and not dont_remove_bold
          @b = false
        end
      end
     
   
     
      for i in 0...info.xsize
        @contents+='<tr>'
        for j in 0...info.ysize
          @contents+='<td>'
          wTxt info[i,j].to_s, false
          #@tactic[i,j] = $game_party.menu_tactic[i,j]
          @contents+='</td>'
        end
      end
     

    end
    @contents+='</table>'
    #Check for count and reduce it
    redCount
  end
 
  #--------------------------------------------------------------------------
  # * wP
  #--------------------------------------------------------------------------
  def wP (text, align='left')
    @contents += "<p align=#{align}>"
    wTxt text
    @contents += "</p>"
  end
 
 
  #--------------------------------------------------------------------------
  # * tForm
  #--------------------------------------------------------------------------
  def tForm(origcodes, count=1)
    # Active count
    @form_count = count
    @count_active = true
   
   
    temp = ''
    # Split codes to extract they
    codes = origcodes.split(',') 
    # Constructs a form code that redo the temporal one
    for code in codes
      # The format functions in a mechanism way for these
      if code == 'b'
        temp += 'b'
     
      elsif code == 'c'
        temp += 'c'

      elsif code == 'u'
        temp += 'u'
     
      # For the others it have to write the font name
      elsif code.to_i.to_s == code
        temp += @size.to_s
       
      elsif code.include? '#'
        temp += '#'+@color
       
      elsif code.include? '@'
        temp += '@'+@bgcolor
       
      else
        temp += @name
       
      end
      temp+=','
    end
   
    # Backup that reversing codes
    @temporal_codes = temp
   
    # Call normal formating to apply the format
    Form origcodes

  end
   
  #--------------------------------------------------------------------------
  # * Form
  #--------------------------------------------------------------------------
  def Form(string)
    # Split string to extract codes
    codes = string.split(',')   #=> ["now's", "the", "time"]
   
    # Iterate in each code and apply it
    for code in codes
      if code == 'b'
        @b ? @b = false : @b = true
     
      elsif code == 'c'
        @c ? @c = false : @c = true

      elsif code == 'u'
        @u ? @u = false : @u = true
     
      elsif code.to_i.to_s == code
        @size = code
       
      elsif code.include? '#'
        @color = code
       
      elsif code.include? '@'
        @bgcolor = code
       
      else
        @name = code
       
      end
    end

  end
 

 
  #--------------------------------------------------------------------------
  # * wHead
  #--------------------------------------------------------------------------
  def wHead(title='')
      @contents += "<html><head><title> #{@title} </title></head> \n"
     
      # Check for count and reduce it
      redCount
  end
 
  #--------------------------------------------------------------------------
  # * wCode
  #--------------------------------------------------------------------------
  def wCode(code)
    @contents += code
           
    # Check for count and reduce it
    redCount
  end
 
  #--------------------------------------------------------------------------
  # * wC
  #--------------------------------------------------------------------------
  def wC(code)
    wCode(code)
  end
 
  #--------------------------------------------------------------------------
  # * wBr
  #--------------------------------------------------------------------------
  def wBr(num=1)
    num.times{|i|@contents += '<br>'}
    wNl
           
    # Check for count and reduce it
    redCount
  end
 
  #--------------------------------------------------------------------------
  # * wHr
  #--------------------------------------------------------------------------
  def wHr(num=1)
    num.times{|i|@contents += '<hr>'}
    wNl
           
    # Check for count and reduce it
    redCount
  end
 
  #--------------------------------------------------------------------------
  # * wNl
  #--------------------------------------------------------------------------
  def wNl
    @contents += "\n"
  end
 
  #--------------------------------------------------------------------------
  # * wH
  #--------------------------------------------------------------------------
  def wH(text, num=2)
    @contents += " <h#{num.to_s}> "
    @contents += text
    @contents += " </h#{num.to_s}> <br> \n "
       
    # Check for count and reduce it
    redCount
  end
 
  #--------------------------------------------------------------------------
  # * wBody
  #--------------------------------------------------------------------------
  def wBody(bgcolor='')
      if bgcolor
        @contents += "<body bgcolor=#{bgcolor}> \n"
      else
        @contents += "<body bgcolor=#{@bgcolor}> \n"
      end
         
    # Check for count and reduce it
    redCount
  end
   
  #--------------------------------------------------------------------------
  # * wList
  #--------------------------------------------------------------------------
  def wList(array, type='ol', style='1')
    # Set the entry mark text based on the list type pased
    if type=='ol'
      entry='li'
     
    elsif type=='dl'
      entry='dt'
     
    end

    # Start list
    @contents += "<#{type} type=#{style} >"
   
    # Write each entry
    for o in array
      # If its ol or li
      if type == 'ol' or type == 'li'
        @contents += "<#{entry}>"
        wTxt(o.to_s)
        @contents += "</#{entry}>"
       
      else
      # If its a dictionary
        @contents += "<#{entry}>"
        wTxt(o[0].to_s)
        @contents += "</#{entry}>"
       
        @contents += "<dd>"
        wTxt(o[1].to_s)
        @contents += "</dd>"
      end
    end
   
    # End list
    @contents += "</#{type}>"
       
    # Check for count and reduce it
    redCount
  end
 
  #--------------------------------------------------------------------------
  # * wImg
  #--------------------------------------------------------------------------
  def wImg(img_source, param='')
    @contents += "<img src=#{img_source} #{param} >"
    wBr
    wNl
       
    # Check for count and reduce it
    redCount
  end
 
  #--------------------------------------------------------------------------
  # * wLink
  #--------------------------------------------------------------------------
  def wLink(link, reftext='')
    @contents += "<a href=#{link}> #{reftext} </a>"
    wBr
    wNl
       
    # Check for count and reduce it
    redCount
  end
 

  #--------------------------------------------------------------------------
  # * wLine
  #--------------------------------------------------------------------------
  def wLine(line)
    wTxt(line)
    @contents += '<br>'
  end
 
  #--------------------------------------------------------------------------
  # * wL
  #--------------------------------------------------------------------------
  def wL(line)
    wLine(line)
  end
 
  #--------------------------------------------------------------------------
  # * wTxt
  #--------------------------------------------------------------------------
  def wTxt(txt, reduce_count=true)
    # Line start
    @contents  = "<font face=#{@name} size=#{@size.to_s} color=#{@color}> "
   
    if @b
      @contents += '<b>'
    end
   
    if @c
      @contents += '<c>'
    end
   
    if @u
      @contents += '<u> '
    end

   
    # Write txt variable
   
    @contents += txt
   
    # Line end
    if @u
      @contents += ' </u>'
    end
   
    if @c
      @contents += '</c>'
    end
   
    if @b
      @contents += '</b>'
    end
   
    @contents += " </font>\n"
   
    # Check for count and reduce it
    redCount if reduce_count
  end
 
  #--------------------------------------------------------------------------
  # * wT
  #--------------------------------------------------------------------------
  def wT(txt)
    wTxt (txt)
  end
 
  #--------------------------------------------------------------------------
  # * wEnd
  #--------------------------------------------------------------------------
  def wEnd
    @contents += '</body></html>'
  end
 
  #--------------------------------------------------------------------------
  # * saveDoc
  #--------------------------------------------------------------------------
  def saveDoc
    file = open(@filename + '.html',  'w')
    file.write(@contents)
    file.close
  end
 
  #--------------------------------------------------------------------------
  # * endSave
  #--------------------------------------------------------------------------
  def endSave
    @contents += '</body></html>'
    file = open(@filename + '.html',  'w')
    file.write(@contents)
    file.close
  end
 
  #--------------------------------------------------------------------------
  # * redCount
  #--------------------------------------------------------------------------
  def redCount
   
    # If its the last count and active, call redo format and end all
    if @form_count-1 == 0 and @count_active
      @count_active = false
      # Reverse temporal format calling the saved redo code
      Form @temporal_codes
      @temporal_codes = ''
     
    # If not reduce count and active
    elsif @count_active
      @form_count-=1
    end
   
  end
end




Instructions

Nothing special. Just insert it before main.

Authors notes

All my scripts are in development and im open to suggestions, critics,  bugs, etc.
14
RPG Maker Scripts / Locations system
January 24, 2011, 02:56:41 pm
Locations system
Version:2
By: gerkrt/gerrtunk

Introduction
This script adds a entry in the main menu(removing steps window)that shows
your actual place. The interesting thing about it is that it lets configure
about anything with flexibility and new features.

Creating locations:

-Using the map tree system. You only have to write the name of the parent map
and all the others under it take his description

-By map name

-By maps groups that share a description

Sublocations:

-By map name

-By maps groups that share a sublocation description

Sublocations allow you to add a specification of the actual area,
so: location "Aoha forest" sublocation "Old tree", for example.

Also you can combine any of these system or options without a problem.


Screenshots



Script

Get a more updated one here: http://usuarios.multimania.es/kisap/english_list.html

Code: text
 
#==============================================================================
# Locations system
# By gerkrt/gerrtunk
# Version: 2
# License: MIT, credits
# Date: 24/01/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

------INTRODUCTION------

This script adds a entry in the main menu(removing steps window)that shows
your actual place. The interesting thing about it is that it lets configure
about anything with flexibility and new features.

Creating locations:

-Using the map tree system. You only have to write the name of the parent map
and all the others under it take his description

-By map name

-By maps groups that share a description

Sublocations:

-By map name

-By maps groups that share a sublocation description

Sublocations allow you to add a specification of the actual area,
so: location "Aoha forest" sublocation "Old tree", for example.

Also you can combine any of these system or options without a problem.


-------CONFIGURING LOCATIONS---------

Location_type : This variable sets the type of locations:
 Location_type = :map_list           -> use map list
 Location_type = :map_name           -> use map name
 Location_type = :map_tree           -> use map tree
 
-By map name: It will just write the actual map name.  

-By map list: Using this you create a group of maps that share a location
description.
 
 Locations_map_id = [
 
   [[1,2,3], 'Ahoha forest'],    # Maps 1,2,3 share Ahoha forest description
   [[4,5,6], 'Sphynx']
 
 ]
 
 Just add lines like this: [[map_id1, map_id2], 'Description'],
 

-By map tree: With this you only have to define a parent map and write its name in
the descriptions. All the maps will have the description, including the parent map.

The map tree is show under the tileset tool. If you doubleclick to - or + you will
see that the maps are shown in groups that depend in parent maps.

Note: I recomend having the maps having the maps ordered and directly relationed with
its parent map to have optimal performance.

Use example:

Mapamundi - Parent of all
 Forest - Parent of maps 3-7
   Mapa3
   Mapa4
   Mapa5 - Parent of 6,7
     Mapa6
     Mapa7
   
 Pantano del Wep
   Mapa9
   
Configuration it:
 
 Locations_map_tree = {
 
  'Forest' => 'Ahoha forest',
  'Prologue' => 'Sphynx'   # All the maps under the map called Prologue have
  # sphynx description
 
 }
 
 To add new locations add these lines:
 'Basename map name' => 'Description',
 

-------CONFIGURING SUBLOCATIONS---------

Show_sublocations : These configurates sublocations


Show_sublocations = :inactive          ---> makes them inactive
Show_sublocations = :map_name         ---> use map name
Show_sublocations = :codes          ---> makes them use map codes


inactive: if they are inactive you are going to see in the first line the
sublocations word

map name: this wall it will simply write the actual map name as a sublocation
description

codes: this works like the locations map list, but for sublocations:

 Sublocations_codes = [
 
   [[1,2], 'Santuary'],
   [[4,5,6], 'Old tree']
 
 ]
 Just add lines like this: [[map_id1, map_id2], 'Description'],
 

------OTHER THINGS------------

Unknown_location_text: This is for maps that dont have a description.
Sublocations_text : Here you can write a prefix for all sublocations
Locations_text : Here you write the describing word of the locations

=end


module Wep
 Unknown_location_text = '?????'
 # :map_tree :map_list :map name
 Location_type = :map_list
 # NEEDS TWO LINES, removes w steps
 Show_sublocations = :inactive       # :inactive, :map_name, :codes

 Sublocations_text = ''
 Locations_text = 'Location'
   
 Locations_map_id = [
 
   [[1,2,3], 'Ahoha forest'],
   [[4,5,6], 'Sphynx']
 
 ]
   
 Sublocations_codes = [
 
   [[1,2], 'Santuary'],
   [[4,5,6], 'Old tree']
 
 ]
 
 Locations_map_tree = {
 
  'Forest' => 'Ahoha forest',
  'Prologue' => 'Sphynx'
 
 }
 
end


#==============================================================================
# ** Window_Locations
#------------------------------------------------------------------------------
#  Show the places you visit
#==============================================================================

class Window_Locations < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(0, 0, 160, 96)
   self.contents = Bitmap.new(width - 32, height - 32)
   refresh
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   
   # Set basic text
   text = Wep::Unknown_location_text

   # If uses the complete hash
   if Wep::Location_type == :map_list
     # Extract text from locations
     for location in Wep::Locations_map_id
       if location[0].include? $game_map.map_id
         text = location[1]
         break
       end
     end
   
   # If uses the map name
   elsif Wep::Location_type == :map_name
     # Load mapinfos for map name
     mapinfos = load_data("Data/MapInfos.rxdata")    
     # Make text
     text = mapinfos[$game_map.map_id].name

   # If it uses the map tree methods
   else
     
     # Iteraves over all base maps searching for tree of the
     # actual map.
     for locname, locdescription in Wep::Locations_map_tree
        # Search for actual map in a defined map tree
        if $game_party.tree_includes_map? (locname)
          text = locdescription
          break
        end
     end
 
   end
   
   # Draw text
   self.contents.clear
 
   # If sub locations use map names, read mapinfos
   if Wep::Show_sublocations == :map_names
       # Load mapinfos for map name
       mapinfos = load_data("Data/MapInfos.rxdata")    
       # Make text
       subtext = Wep::Sublocations_text + mapinfos[$game_map.map_id].name
       # Draw using classic style
       self.contents.font.color = system_color
       self.contents.draw_text(4, -5, 120, 32, text)
       self.contents.font.color = normal_color
       self.contents.draw_text(4, 32, 120, 32, subtext, 2)
       
   # If sub locations use map codes, iterate sublocations
   elsif Wep::Show_sublocations == :codes
     # Extract text from sublocations
     for sublocation in Wep::Sublocations_codes
       if sublocation[0].include? $game_map.map_id
         subtext = Wep::Sublocations_text + sublocation[1]
         break
       end
     end
     # Draw using classic style
     self.contents.font.color = system_color
     self.contents.draw_text(4, -5, 120, 32, text)
     self.contents.font.color = normal_color
     self.contents.draw_text(4, 32, 120, 32, subtext, 2)
     
   # If not, draw using Locations word    
   else
     self.contents.font.color = system_color
     self.contents.draw_text(4, -5, 120, 32, Wep::Locations_text)
     self.contents.font.color = normal_color
     self.contents.draw_text(4, 32, 120, 32, text, 2)
     
   end

 end
end

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------
# Added method tree includes map
#==============================================================================

class Game_Party
 #--------------------------------------------------------------------------
 # * Tree includes map?
 #  look for the name given in actual map tree
 #--------------------------------------------------------------------------
 def tree_includes_map? (name)
   # Load mapinfos for map name
   mapinfos = load_data("Data/MapInfos.rxdata")    
   # If his name is the name searched
   if mapinfos[$game_map.map_id].name == name
       return true
   end

   map = $game_map.map_id
 
   # Iterate all parents maps
   while mapinfos[map].parent_id != 0
       if mapinfos[mapinfos[map].parent_id].name == name
         return true
       else
         map = mapinfos[map].parent_id
       end
   end
 end


Instructions

Nothing special. Just insert it before main.

Authors notes

All my scripts are in development and im open to suggestions, critics,  bugs, etc.
15
RPG Maker Scripts / Battle log window
January 24, 2011, 02:51:09 pm
Battle log window
Version:1
By: gerkrt/gerrtunk

Introduction

This window shows a new window and in battle that displays a list of the last
actions executed.
You can configure witdh, lines heigh, x and y and all the vocabulary used.


Screenshots



Script

Get a more updated one here: http://usuarios.multimania.es/kisap/english_list.html

Code: text
 
#==============================================================================
# Battle log window
# By gerkrt/gerrtunk
# Version: 1
# License: MIT, credits
# Date: 24/01/2011
# IMPORTANT NOTE: to acces the more actualitzed or corrected version of this
# script check here: http://usuarios.multimania.es/kisap/english_list.html
#==============================================================================

=begin

------INTRODUCTION------

This window shows a new window and in battle that displays a list of the last
actions executed.
You can configure witdh, lines heigh, x and y and all the vocabulary used.

-----INSTRUCTIONS-------

The vocabulary is pretty self explanatory. Thet are the variables called Voc and
they dot whay you see. Note that a . is added always at the end of a phrase.

Lines height is the max lines of the log window.

Battle window X and Y control these positions. You can changue they at your will
for aesthetichs or improve interface.
 
Finall You can modifiy the Battle witdht window if you think that it takes too
space or you need more.

=end

module Wep
 
  Lines_height = 6

  BattleWindow_Width = 220
  Wep::BattleWindow_X = 0
  Wep::BattleWindow_Y = 96

  VocStart = 'Battle starts!'
  VocMiss = ' missed'
  VocAtk = ' attacked'
  VocDies = ' fall'
  VocWin = 'You win!'
  VocLose = 'You lose!'
  VocEscape = 'You escaped!'
  VocEscapeFails = 'You failed to escape'
  VocMag = ' cast '
  VocItem = ' use '
  VocDef = ' defended'
  VocNothing = ' does nothing'
 
end





class Game_Battler
    #--------------------------------------------------------------------------
  # * Change HP
  #     hp : new HP
  # moded to add log line in battle if dead
  #--------------------------------------------------------------------------
  def hp=(hp)
    @hp = [[hp, maxhp].min, 0].max
    # Add log line if in battle and dead
    if self.dead? and $game_temp.in_battle
      $scene.log_add_line(Wep::VocDies, self)
    end
    # add or exclude incapacitation
    for i in 1...$data_states.size
      if $data_states[i].zero_hp
        if self.dead?
          add_state(i)
        else
          remove_state(i)
        end
      end
    end
  end

end

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Battle Ends
  #     result : results (0:win 1:escape 2:lose)
  #--------------------------------------------------------------------------
  def battle_end(result)
   
    case result
      when 0; @log_window.add_special_line(Wep::VocWin)
      when 1; @log_window.add_special_line(Wep::VocLose)
    end

    # Clear in battle flag
    $game_temp.in_battle = false
    # Clear entire party actions flag
    $game_party.clear_actions
    # Remove battle states
    for actor in $game_party.actors
      actor.remove_states_battle
    end
    # Clear enemies
    $game_troop.enemies.clear
    # Call battle callback
    if $game_temp.battle_proc != nil
      $game_temp.battle_proc.call(result)
      $game_temp.battle_proc = nil
    end
    # Switch to map screen
    $scene = Scene_Map.new
  end
  #--------------------------------------------------------------------------
  # * Make Skill Action Results
  #--------------------------------------------------------------------------
  def make_skill_action_result
    # Get skill
    @skill = $data_skills[@active_battler.current_action.skill_id]
    # If not a forcing action
    unless @active_battler.current_action.forcing
      # If unable to use due to SP running out
      unless @active_battler.skill_can_use?(@skill.id)
        # Clear battler being forced into action
        $game_temp.forcing_battler = nil
        # Shift to step 1
        @phase4_step = 1
        return
      end
    end
    # Use up SP
    @active_battler.sp -= @skill.sp_cost
    # Refresh status window
    @status_window.refresh
    # Show skill name on help window
    @help_window.set_text(@skill.name, 1)
    # Set animation ID
    @animation1_id = @skill.animation1_id
    @animation2_id = @skill.animation2_id
    # Set command event ID
    @common_event_id = @skill.common_event_id
    # Set target battlers
    set_target_battlers(@skill.scope)
    # Add log line
    $scene.log_add_line(Wep::VocMag, @active_battler, @skill.name)
    # Apply skill effect
    for target in @target_battlers
      target.skill_effect(@active_battler, @skill)
    end
  end
  #--------------------------------------------------------------------------
  # * Make Item Action Results
  #--------------------------------------------------------------------------
  def make_item_action_result
    # Get item
    @item = $data_items[@active_battler.current_action.item_id]
    # If unable to use due to items running out
    unless $game_party.item_can_use?(@item.id)
      # Shift to step 1
      @phase4_step = 1
      return
    end
    # If consumable
    if @item.consumable
      # Decrease used item by 1
      $game_party.lose_item(@item.id, 1)
    end
    # Display item name on help window
    @help_window.set_text(@item.name, 1)
    # Set animation ID
    @animation1_id = @item.animation1_id
    @animation2_id = @item.animation2_id
    # Set common event ID
    @common_event_id = @item.common_event_id
    # Decide on target
    index = @active_battler.current_action.target_index
    target = $game_party.smooth_target_actor(index)
    # Set targeted battlers
    set_target_battlers(@item.scope)
    # Add log line
    $scene.log_add_line(Wep::VocItem, @active_battler, @item.name)
    # Apply item effect
    for target in @target_battlers
      target.item_effect(@item)
    end
  end
  #--------------------------------------------------------------------------
  # * Make Basic Action Results
  #--------------------------------------------------------------------------
  def make_basic_action_result
    # If attack
    if @active_battler.current_action.basic == 0
      # Add log line
      $scene.log_add_line(Wep::VocAtk, @active_battler)
      # Set anaimation ID
      @animation1_id = @active_battler.animation1_id
      @animation2_id = @active_battler.animation2_id
      # If action battler is enemy
      if @active_battler.is_a?(Game_Enemy)
        if @active_battler.restriction == 3
          target = $game_troop.random_target_enemy
        elsif @active_battler.restriction == 2
          target = $game_party.random_target_actor
        else
          index = @active_battler.current_action.target_index
          target = $game_party.smooth_target_actor(index)
        end
      end
      # If action battler is actor
      if @active_battler.is_a?(Game_Actor)
        if @active_battler.restriction == 3
          target = $game_party.random_target_actor
        elsif @active_battler.restriction == 2
          target = $game_troop.random_target_enemy
        else
          index = @active_battler.current_action.target_index
          target = $game_troop.smooth_target_enemy(index)
        end
      end
      # Set array of targeted battlers
      @target_battlers = [target]
      # Apply normal attack results
      for target in @target_battlers
        target.attack_effect(@active_battler)
      end
      return
    end
    # If guard
    if @active_battler.current_action.basic == 1
      # Display "Guard" in help window
      # Add log line
      $scene.log_add_line(Wep::VocDef, @active_battler)
      @help_window.set_text($data_system.words.guard, 1)
      return
    end
    # If escape
    if @active_battler.is_a?(Game_Enemy) and
       @active_battler.current_action.basic == 2
      # Add log line
      # @log_window.add_special_line(Wep::VocEscaping)

      # Display "Escape" in help window
      @help_window.set_text("Escape", 1)
      # Escape
      @active_battler.escape
      return
    end
    # If doing nothing
    if @active_battler.current_action.basic == 3
      # Add log line
      $scene.log_add_line(Wep::VocNothing, @active_battler)
      # Clear battler being forced into action
      $game_temp.forcing_battler = nil
      # Shift to step 1
      @phase4_step = 1
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (party command phase: escape)
  #--------------------------------------------------------------------------
  def update_phase2_escape
    # Calculate enemy agility average
    enemies_agi = 0
    enemies_number = 0
    for enemy in $game_troop.enemies
      if enemy.exist?
        enemies_agi += enemy.agi
        enemies_number += 1
      end
    end
    if enemies_number > 0
      enemies_agi /= enemies_number
    end
    # Calculate actor agility average
    actors_agi = 0
    actors_number = 0
    for actor in $game_party.actors
      if actor.exist?
        actors_agi += actor.agi
        actors_number += 1
      end
    end
    if actors_number > 0
      actors_agi /= actors_number
    end
    # Determine if escape is successful
    success = rand(100) < 50 * actors_agi / enemies_agi
    # If escape is successful
    if success
      # Add log line
      @log_window.add_special_line(Wep::VocEscape)
      # Play escape SE
      $game_system.se_play($data_system.escape_se)
      # Return to BGM before battle started
      $game_system.bgm_play($game_temp.map_bgm)
      # Battle ends
      battle_end(1)
    # If escape is failure
    else
      # Add log line
      @log_window.add_special_line(Wep::VocEscapeFails)
      # Clear all party member actions
      $game_party.clear_actions
      # Start main phase
      start_phase4
    end
  end
end

#==============================================================================
# ** Scene_Battle (part 1)
#------------------------------------------------------------------------------
#  This class performs battle screen processing.
#==============================================================================

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Main Processing
  # moded to use
  #--------------------------------------------------------------------------
  def main
    # Initialize each kind of temporary battle data
    $game_temp.in_battle = true
    $game_temp.battle_turn = 0
    $game_temp.battle_event_flags.clear
    $game_temp.battle_abort = false
    $game_temp.battle_main_phase = false
    $game_temp.battleback_name = $game_map.battleback_name
    $game_temp.forcing_battler = nil
    # Initialize battle event interpreter
    $game_system.battle_interpreter.setup(nil, 0)
    # Prepare troop
    @troop_id = $game_temp.battle_troop_id
    $game_troop.setup(@troop_id)
    # Make actor command window
    s1 = $data_system.words.attack
    s2 = $data_system.words.skill
    s3 = $data_system.words.guard
    s4 = $data_system.words.item
    @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])
    @actor_command_window.y = 160
    @actor_command_window.back_opacity = 160
    @actor_command_window.active = false
    @actor_command_window.visible = false
    # Make other windows
    @party_command_window = Window_PartyCommand.new
    @help_window = Window_Help.new
    @help_window.back_opacity = 160
    @help_window.visible = false
    @status_window = Window_BattleStatus.new
    @message_window = Window_Message.new
   
    @log_window = Window_BattleLog.new(@troop_id)
    @log_window.add_special_line(Wep::VocStart)
   
    # Make sprite set
    @spriteset = Spriteset_Battle.new
    # Initialize wait count
    @wait_count = 0
    # Execute transition
    if $data_system.battle_transition == ""
      Graphics.transition(20)
    else
      Graphics.transition(40, "Graphics/Transitions/" +
      $data_system.battle_transition)
    end
    # Start pre-battle phase
    start_phase1
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Refresh map
    $game_map.refresh
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @actor_command_window.dispose
    @party_command_window.dispose
    @help_window.dispose

    @log_window.dispose
    @status_window.dispose
    @message_window.dispose
    if @skill_window != nil
      @skill_window.dispose
    end
    if @item_window != nil
      @item_window.dispose
    end
    if @result_window != nil
      @result_window.dispose
    end
    # Dispose of sprite set
    @spriteset.dispose
    # If switching to title screen
    if $scene.is_a?(Scene_Title)
      # Fade out screen
      Graphics.transition
      Graphics.freeze
    end
    # If switching from battle test to any screen other than game over screen
    if $BTEST and not $scene.is_a?(Scene_Gameover)
      $scene = nil
    end
  end
 
  #--------------------------------------------------------------------------
  # * Frame Update
  # moded to use
  #--------------------------------------------------------------------------
  def update
    # If battle event is running
    if $game_system.battle_interpreter.running?
      # Update interpreter
      $game_system.battle_interpreter.update
      # If a battler which is forcing actions doesn't exist
      if $game_temp.forcing_battler == nil
        # If battle event has finished running
        unless $game_system.battle_interpreter.running?
          # Rerun battle event set up if battle continues
          unless judge
            setup_battle_event
          end
        end
        # If not after battle phase
        if @phase != 5
          # Refresh status window
          @status_window.refresh
        end
      end
    end
    # Update system (timer) and screen
    $game_system.update
    $game_screen.update
    # If timer has reached 0
    if $game_system.timer_working and $game_system.timer == 0
      # Abort battle
      $game_temp.battle_abort = true
    end
    # Update windows
    @help_window.update
    @party_command_window.update
    @actor_command_window.update
    @log_window.update
    @status_window.update
    @message_window.update
    # Update sprite set
    @spriteset.update
    # If transition is processing
    if $game_temp.transition_processing
      # Clear transition processing flag
      $game_temp.transition_processing = false
      # Execute transition
      if $game_temp.transition_name == ""
        Graphics.transition(20)
      else
        Graphics.transition(40, "Graphics/Transitions/" +
        $game_temp.transition_name)
      end
    end
    # If message window is showing
    if $game_temp.message_window_showing
      return
    end
    # If effect is showing
    if @spriteset.effect?
      return
    end
    # If game over
    if $game_temp.gameover
      # Switch to game over screen
      $scene = Scene_Gameover.new
      return
    end
    # If returning to title screen
    if $game_temp.to_title
      # Switch to title screen
      $scene = Scene_Title.new
      return
    end
    # If battle is aborted
    if $game_temp.battle_abort
      # Return to BGM used before battle started
      $game_system.bgm_play($game_temp.map_bgm)
      # Battle ends
      battle_end(1)
      return
    end
    # If waiting
    if @wait_count > 0
      # Decrease wait count
      @wait_count -= 1
      return
    end
    # If battler forcing an action doesn't exist,
    # and battle event is running
    if $game_temp.forcing_battler == nil and
       $game_system.battle_interpreter.running?
      return
    end
    # Branch according to phase
    case @phase
    when 1  # pre-battle phase
      update_phase1
    when 2  # party command phase
      update_phase2
    when 3  # actor command phase
      update_phase3
    when 4  # main phase
      update_phase4
    when 5  # after battle phase
      update_phase5
    end
  end
 
 
  # Chequea turno, linea, posa . final,etc
  def log_add_line(line, origin, extra='')
    complete = origin.name + line + extra + '.'

    @log_window.add_line(complete)
    @log_window.refresh
  end
 
end

#==============================================================================
# ** Window_BattleLog
#------------------------------------------------------------------------------
#  This window displays amount of gold and EXP acquired at the end of a battle.
#==============================================================================

class Window_BattleLog < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     exp       : EXP
  #     gold      : amount of gold
  #     treasures : treasures
  #--------------------------------------------------------------------------
  def initialize(troop_id)
    @small_list = []
    @troop_id = troop_id
    #Wep::Lines_height.times {@list.push('')}
    Wep::Lines_height.times {@small_list.push('')}
    # until this, no contents
    super(Wep::BattleWindow_X, Wep::BattleWindow_Y, Wep::BattleWindow_Width, Wep::Lines_height * 32 + 32)
    self.z = 99
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
 
  def end_log
    if Wep::Battle_Ends[@troop_id] != nil
      @list.push Wep::Battle_Ends[@troop_id]
    else
      @list.push Wep::Default_End
    end

    @list.push Wep:Battle_Ends[troop_id]
  end
 
  def refresh
    self.contents = Bitmap.new(width - 32, height - 32)
    for i in 0...@small_list.size
      self.contents.draw_text(0, i * 32, Wep::BattleWindow_Width-32, 32, @small_list[i], 1)
    end

  end
 
  def add_line(line)
    # Add to the start and move
    @small_list.unshift(line)
    # Remove last element
    @small_list.pop
  end
 
  def add_special_line(line)
    # Add to the start and move
    @small_list.unshift(line)
    # Remove last element
    @small_list.pop
    refresh
  end
 
end


Instructions

Nothing special. Just insert it before main.

Authors notes

All my scripts are in development and im open to suggestions, critics,  bugs, etc.
16
RPG Maker Scripts / Improved impact rates
January 18, 2011, 10:04:09 am
Improved impact rates
Version:1
By: gerkrt/gerrtunk

Introduction

This script completely revamps the classic impact rate calculations. Now you have
a full control of the random targets of the enemies.

You can set it now by:

-Positions in actor group
-Actor
-Classes
-Armors
-Weapons

You can also set a Max and a Base impact rate values, and add a inernal correction
to any actor that can be temporal or not and is setted via script call.

Finally it adds the option to use the default clasic values for actors postions, but
now you can set the rate value of rear, front and mid guard.


Screenshots

Not valid for this script.

Script

Get it here: http://usuarios.multimania.es/kisap/english_list.html

Instructions

Nothing special. Just insert it before main.

Authors notes

All my scripts are in development and im open to suggestions, critics,  bugs, etc.
17
RPG Maker Scripts / Modifiy combat step rate command
January 05, 2011, 08:26:24 pm
This script adds a lost feature from old rpgmakers: the changue combate rate command. It also lets you restart it.

You can ask for bugs, suggerences, compatibilitzations and any other things.

You can get the code in this simple web. Im going to use it on now because it saves alot of time updating posts and other things.

http://usuarios.multimania.es/kisap/english_list.html
18
This script gives a little control to create and modifiy text files to eventers.
You can create a file, erase it, append text, add or remove a specific line.
Also you can configure the files extensions and paths.

You can ask for bugs, suggerences, compatibilitzations and any other things.

You can get the code in this simple web. Im going to use it on now because it saves alot of time updating posts and other things.

http://usuarios.multimania.es/kisap/english_list.html
19
Script Requests / Scripter looking for paid jobs
December 29, 2010, 08:47:05 pm
Note: I dont know if this is the best place for this thread. If not, move it.

My conditions:
-You will have to reconaice my work in some way.
-You cant take the credits or authory of my work.
-If you give up with your project i will release my work with a open licencese, even if its locked. Im not going to script something that cant be useful for anyone.

My works:
Published scripts
-Improved save
-Multiusable items
-Restricted use items
-Improved shop
-Betatester diary
-Picture text command
-Warning message
-Challengue compensator.
-Buff/Debuff dragonquest skills
-Weapons % state rates

In development or unreleased

"EXPAND": ShowHide

-Location system. This a complete location system but also adds extra information to locations and creates the mapamundi tree dinamically.
-Information books system. This a system that opens a menu for information and you look for books you find in your quests and open them.
-Improved combat rate and step count. This is a little script that let you control all the combat step count, modifing it, frezking, reseting, etc..
-Memory cards minigame. It also  have its own AI.
-A tactics system for battles that use a table with a lot positions. It can measure battlers distance and check for extra valid file effects(like with status effects that disable that)

-Three combat addons for the ACBS:
The first is a expanded version of atoa status with some more and making all function also with equipment,class,ec
The second is a general battle effects script that add things like weapons that can only hit flying enemies, or that make random damage... it have 25 of that effects for now.
The last is a small script created to view ACBS like a frontview one with improved features.

-A complex skill system. Althoug i created it ith other script as a base(equip skills window and scene) my addon its complex. The skills can affect to all actors atributes, create equipment, items or skills restrictions, learn skills and actiovate some special effects.
It also works with a table with 7 levels and the power of the skill depends of the position and the effect and the context(other skills, ows,etc) can changue, can be blocked,anulated...

-Improved events commands: this add removed functionalities to XP, like the option call comands with event variables. Also it add new commands and new functions for old ones.
-Im writing a manual for rgss users.
-A huge combat addon for the DBS. That added 8 new status and a lot of effects for battle and equipment.
-Enemy AI scipt. This have 12 levels of AI, including learning from mistakes and have like human conciencie.

I also have knowledges of php, python, perl, bash, c, c#, vb and java. I also progam in gtk and pygame/sdl.

Description of the items system, wich have thousands of code:



The esthetics are temporal.

The reason to create it was my need of a limited item system based on weight with a bag for every actor. I created it with old DW experiencies in mind, where shopping/moving/using items was a painful experiencie that make you lose like 20m everytime.

Tool bar with this functions:
-Exchangue all the items betwen two actors.
-Send a bag to the temporal.
-Erase bag.
-Empty the temporal.
-Send all bags to the temporal.
-Two sort algorithms.
-Open selection window.

Math bar
-Selected item number
-Selected items total weight.
-A relationn betwin selection weight and the bag in wich the cursor is.

Wastepaper: Neutral icon. One of the ways of deleting items.

Item window: Face, actual weight/max. It shows the actor equipment, and you can changue it. Anyway you cant see the item description or effects, iys just for quick andknow changues.

Temporal window: This window dont have max weight and itsfunction is to be used for some functions and to give to the plyer some flexibility.
The items you erase are puted here, and before quiitting it will show a
warning checking for confirmation.

Selection window: It shows all the selected items merged. With this you can recolocate the tem number with a few seconds.

Move betwen windows: Two keys for that. Anyway exist a system that make that all the windows are treated like a one. This make that if you move to a window border the index willlbe traspased to the next with the more logic position posible.

Selection mode: With this you can select a group of items. There arent any restrictions, you can select from any actor. Then you can move or erase it all. When you select a item, you can also select it number.


What can i do (ideas  about what people might want:

First, i mainly use XP but i can use VX with no problem.

-Port scripts to VX or VX-XP.
-Compatibilitze scripts,debug, support and add some features or slightly modifications. With this you can use a lot of new systems that where incompatible and add some extra things.
-Creation of a simple script or system. Like a multiusable items or restricted items, or simple skill system.
-Skill systems. These systems are more hard and complex to do.
-Complex systems and scripts like new menus systems.
-Menus arrangements. These are with a menu script already created. I tweak the aesthetics and add a few things.
-Battle systems. These are one of  the hardest thing in rpgmaker, and i doubt that anyone from here can pay for creating one from scratch. ¿What can we do? Well, i can create addons for some battlesystems to make what you want. The CBS i use for my own projects is the Atoa's CBS, so is the system i will suggest to use, anyway i can work with anyone.

Work analysys and paidment
You send my work and then i analize it. You must add a very complex description and design document of every think you want. If you are willing for some specifics visuals you will have to create images for everything and give me all the resourves i need. The images can be done just using paint, the idea is to write text positions, colors, sizes, windows,commands, etc, here....

I will then return the cost. That cost will be fixed with its complexity and time to spent in mind.  I will never use a payment x worked hours.

Other type of payments, like % of the game profit will discused separately.

The payment process will depend of the user. I wont do anything for a user with 5 msg without being paid(or at least being paid some money in advance). I dont have a lot of messages but i have a reputation as scripter, creator and user and im not anonymous.

Prices examples

Compatibilitze,debug,etc: 15-40
Complex skill system: 100-200
Menu arrangements: 15-30
Simple script: 10-50
Complex script: 50-250

Anyway thats only a idea.

Last notes

Dont ask to complete analyze a thing by just the sake of doing it. It costs me time. But dont worry to do any simple questions.

Also im spanish, if you are thinking in my bad english. Anyway i can rad and write functionally.

Estimated worktimes and prices for some of my scripts

% based weapons states rates: This is most simpler script. It took me the just time of studying where the states are applied. Any script beyond 0-1hour will cost 5$.

DragonQuest buff/debuff skills
I created the DragonQuest buff/debuff skills with this is in mind. Although i cant program at 100%, it taked me 1:40, and 20m of documentation and post.

But i think in other situation i can make it more quick.So i will rate its price at 10$.

Improved Save: That is a trully complexe script. Not because it have hard problems to solve but because have a lot of functions and options, and the coding time rises also. Its a very huge one.
Price: 120$

Improved shop: Pretty easy. Not much code, not hard problems. 10$.


-Picture text command
: Small code, hard problem, learning how pictures works and making the event call function with new options.
20$

-Restricted items:Seems easy but its hard to create, a lot of conditions and modifiacciotns to the battle system and all the items applies in and out. The apply and use functions are very complex.
35$

-Items System: My item system writed in a few posts before. This is my hardest and most complex script, and its like the save system. I have the functions of like 4 o 5 scripts and a lot of work. Not in the best way, but if i programed it now it will cost a lot anyway.

200$
20
RPG Maker Scripts / Buff/debuff dragonquest style skills
December 23, 2010, 09:55:59 pm
This script retruns a function that was in old rpgmakers and in games like dragon quest: the option to reduce or sum battlers atributes temporally in combat based in a fixed number and not using %.

You can ask for bugs, suggerences, compatibilitzations and any other things.

You can get the code in this simple web. Im going to use it on now because it saves alot of time updating posts and other things.


http://usuarios.multimania.es/kisap/english_list.html
21
RPG Maker Scripts / % based weapons states rates
December 23, 2010, 09:55:03 pm
Normally you can add any combination of states for weapons,
but you dont have any other control. With this you can use any state based on %. It functions like old rpgmakers ones.

You can ask for bugs, suggerences, compatibilitzations and any other things.

You can get the code in this simple web. Im going to use it on now because it saves alot of time updating posts and other things.

http://usuarios.multimania.es/kisap/english_list.html
22
RMXP Script Database / [XP] Improved Save
November 07, 2010, 02:22:29 pm
Improved save
Authors: gerrtunk
Version: 1
Type: A all-in-one save system
Key Term: Title / Save / Load / GameOver Add-on




Introduction

This script has been created with the idea to give the maxium freedom and
possibilities to the creator. I think this system open many new ways, but i may
take some work for you.

Anyway the script comes with a working default configuration for each feature and
also have the option to make autoconfigurations. Turning on/off a feature only
needs to changue one option.



Features

Main systems:

-Autosave system with temporizer or/and map script calls. The autosave warns you
activating a switch everytime is autosaved. Use a reserved slot for this system
that can be protected.

-Quicksave system. This lets the player to save everywhere, with the condition that
the quick savegame will be erased. Use a reserved slot for this system, that can be
protected. It have a must load option that protect agains cheaters.

-One slots modes. They make all the save and load process automatically. Also exist
a Quicksaving one slot mode that works like roguelikes ones.

-Complete event save control system. You can now save, load, erase, check if
savegame exist, keep savegame information in event variables, quick save
and autosave with simple script calls. It also have a function to call the load
game menu.

-Very complex and complete graphic personalitzation. Now savegames can show:
 steps
 map description(based on maps id)
 map name
 gameplay time
 date
 description(a text thats saved with the game. Ex: "Chapter I")
 money
 completed game(based on event variable)
 
 actors names
 actors levels
 actors graphics
 actors faces

There are two graphic configuration modes. With the automatic you can set all that
things in two lines, but with the advanced you can select also every option position.
and other extra things.

It also add the follow features:
 -Backwindows and backscene based on images
 -You can configurate windows transparencys and visibility.
 -Some control over the fonts.

Other features:
 -You can select savegame folder, savegames names and extensions.
 -Warning messages.
 -Main menu quicksave entry
 -Configurable slot number.
 -Extended vocabulary configuration
 -High compatibality. You can disable individually the changues to game_system,
 title, end or main menu.
 
In progress features:
 -Slot sort system
 -Graphic mode with one actor games in mind.
 -Improved slot visually identification.
 -Definition of font for each text.
 -Some compatibility improvements
 -Graphics and interace improvements

Planned features:
 -Use of icons
 -New base graphic styles
 -More complex save scene
 -Screen captures
 -Extended roguelike style support



Screenshots

Spoiler: ShowHide




Demo

No



Script

The script code is too long. Check  http://www.hbgames.org/forums/viewtopic.php?f=11&t=73016 or http://pastebin.com/u/gerkrt



Instructions

You have to add two scripts. The first one its the configurator, and the second the script code. You have to put they in this order before main script.
The rest in the script.



Compatibility

In the script.



Credits and Thanks

No.



Author's Notes

All my scripts are in development. I will listend to feedback, bugs, etc,
23
RPG Maker Scripts / Difficulty effects
November 07, 2010, 10:15:43 am
This script gives a complete control of the game challengue, not only with a initial decision.

Features:

-You can create all the difficulty effects you want and active and desactive at your will. Each effect can changue some nemy atributes based in %.
The effects are accumulative and saved when quit the game.

4 ways of choosing what enemies are using the effects:

-By enemies ids
-By maps ids
-Using the map tree system. You only have to write the name of the parent map and all the others are included in the effect.
-Global

-All the atributes are optional.

-You can use the value in a event variable to control all the values of a effect in real time.

-HP, SP, ATK, PDEF, PMAG, EVS, STR, DEX, AGI, INT, EXPERIENCIE, GOLD and DROP


As usual, the script is in development. Bugs,sugerences,etc...

Also i suppose that this script might be incompatible with other difficulty scripts. Just ask for a compatibilitzation.

Code: text
#==============================================================================
# Difficulty effects
# By gerkrt/gerrtunk
# Version: 1
# License: GPL, credits
#==============================================================================

=begin

This script gives a complete control of the game challengue, not only with a
initial decision.

Features:

-You can create all the difficulty effects you want and active and desactive
at your will. Each effect can changue some nemy atributes based in %.
The effects are accumulative and saved when quit the game.

4 ways of choosing what enemies are using the effects:

-By enemies ids
-By maps ids
-Using the map tree system. You only have to write the name of the parent map
and all the others are included in rhe effect.
-Global

-All the atributes are optional.

-You can use the value in a event variable to control all the values of a effect
in real time.

-HP, SP, ATK, PDEF, PMAG, EVS, STR, DEX, AGI, INT, EXPERIENCIE, GOLD and DROP


############ Values and sintaxis #########

Enemies atributes are calculated in %. Each atribute you add to a effect to
modify starts wuth a value of 100% and then you can sum or rest to it.

Example:
      Difficulty_effects[5] = {   
    :active  => false,           
    :type  => 3,                 
    :base_map_name  => 'Forest',   
    :hp => 50,                   
    :sp =>-30             
    }
 
This makes that the hp is 150 and sp 70.

:x => value of x,

You must respect :  before x name, the => separating them and the final ,

-Each new effect must have a new and unique number ID in Difficulty_effects[ID]
-Dont touch the {}. They mean start and end and have to be in that positions.
-You can add or remove any values, just use the same sintaxis.
-The last value dont use the  final ,


############ Option types #########
 

Obligatory:

active: If you give this a true value the script will start actived.

type: Define how is going to know the script wich enemies affect.
Values:
  1.By enemies ids
  2.By maps ids
  3.By map tree
  4.Global
 
enemies_ids: Obligatory when type is 1. Define wich enemies are affected.
  :enemies_ids => [1,2,3]
 
maps_ids: Obligatory when type is 2. Define wich maps are affected.
  :maps_ids => [1,2,3]

base_map_name: Obligatory when type is 3. Define the parent map name.

Optionals:

variable: Makes that all values of the effect depend of that event variable value.
value*event_variable/100

hp 
sp 

atk   
pdef 
mdef
evs   

str   STRENGTH
dex   DEXTERITY
agi   AGILITY
int   INTELIGENCE

exp   EXPERIENCIE
gold  MONEY
drop  % OF ITEMS

Note that you can erase the example effects.

############ Select wich enemies will use the effect #########


-Global. All combats

-By enemies: Only the enemies that you add to the list.

-By maps: All combats in the maps that you add to the list.

-By map tree: With this you only have to define a parent map and write its name in
the effect. All the maps and combats under it will have the effect.

The map tree is show under the tileset tool. If you doubleclick to - or + you will
see that the maps are shown in groups that depend in parent maps.

Note: I recomend having the maps having the maps ordered and directly relationed with
its parent map to have optimal performance.

Use example:

Mapamundi
  Forest
    Mapa3
    Mapa4
    Mapa5
      Mapa6
      Mapa7
     
  Pantano del Wep
    Mapa9
   
Ex:
   
      Difficulty_effects[2] = {
    :active  => false,
    :hp => 50,
    :sp => 30,
    :atk   => 20,
    :spi   => 20,
    :agi   => 10,
    :drop  => -20,
    :variable  => 6,
    :type  => 3,
    :base_map_name  => 'Forest'
  }

 
Maps 3,4,5,6,7, and Forest have that effect.


############ Activating effects #########

Activate: start_difficulty_effect(effect number)

Desactivate: stop_difficulty_effect(effect number)

Ex: start_difficulty_effect(1)

############ Last notes #########

-All the effects to an enemy are sumed and then applied.

-You can create large number groups with this:

  :enemies_ids => (1..25).to_a
 
  This is like putting the enemies ids 1-25
 
-Creditss: this script have been created studying  KGC
BattleDifficuly


=end

module Wep
  # Dont touch this
  Difficulty_effects = []
 
 
  Difficulty_effects[1] = {
    :active  => false,
    :hp => 50,
    :mp => 30,
    :atk   => 20,
    :agi   => 10,
    :drop  => 20,
    :variable  => 4,
    :type  => 1,
    :enemies_ids  => [2,3]
  }
    Difficulty_effects[2] = {
    :active  => false,
    :hp => 50,
    :mp =>30,
    :atk   => 20,
    :agi   => 10,
    :drop  => 20,
    :gold => 20,
    :exp => 20,
    :variable  => 5,
    :type  => 2,
    :maps_ids  => [1,2,3,4,6,7]
  }
      Difficulty_effects[3] = {
    :active  => false,
    :hp => 50,
    :mp => 30,
    :atk   => 20,
    :dex   => 20,
    :agi   => 10,
    :drop  => -20,
    :variable  => 6,
    :type  => 3,
    :base_map_name  => 'Forest'
  }
        Difficulty_effects[4] = {
    :active  => false,
    :hp => 50,
    :mp => 30,
    :atk   => 20,
    :agi   => 10,
    :drop  => -20,
    :variable  => 6,
    :type  => 4
  }
 
end

class Game_System
  attr_accessor :difficulty_effects
  alias gs_wep_cc_init initialize
  def initialize
    @difficulty_effects = Wep::Difficulty_effects
    gs_wep_cc_init
  end
 
end

class Interpreter
 
  def start_difficulty_effect(num)
     $game_system.difficulty_effects[num][:active] = true
  end
 
  def stop_difficulty_effect(num)
     $game_system.difficulty_effects[num][:active] = false
  end

end 

class Game_Party
  def tree_includes_map? (name)
    # Load mapinfos for map name
    mapinfos = load_data("Data/MapInfos.rxdata")   
    # If his name is the name searched
    if mapinfos[$game_map.map_id].name == name
        return true
    end

    map = $game_map.map_id
   
    # Iterate all parents maps
    while mapinfos[map].parent_id != 0
        if mapinfos[mapinfos[map].parent_id].name == name
          return true
        else
          map = mapinfos[map].parent_id
        end
    end
  end
end

#==============================================================================
# ■ Game_Enemy
#==============================================================================

class Game_Enemy < Game_Battler
  #--------------------------------------------------------------------------
  # ● MaxHP
  #--------------------------------------------------------------------------
  alias base_maxhp_Challengue_Compensator base_maxhp
  def base_maxhp
    # Gets normal atribute
    n = base_maxhp_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:hp] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:hp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:hp]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:hp] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:hp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:hp]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:hp] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:hp]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:hp]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:hp] != nil
           if effect[:variable] != nil
             total+=effect[:hp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:hp]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● MaxSP
  #--------------------------------------------------------------------------
  alias base_maxsp_Challengue_Compensator base_maxsp
  def base_maxsp
    # Gets normal atribute
    n = base_maxsp_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:sp] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:sp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:sp]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:sp] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:sp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:sp]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:sp] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:sp]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:sp]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:sp] != nil
           if effect[:variable] != nil
             total+=effect[:sp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:sp]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxstr
  #--------------------------------------------------------------------------
  alias base_str_Challengue_Compensator base_str
  def base_str
    # Gets normal atribute
    n = base_str_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:str] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:str]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:str]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:str] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:str]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:str]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:str] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:str]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:str]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:str] != nil
           if effect[:variable] != nil
             total+=effect[:str]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:str]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxdex
  #--------------------------------------------------------------------------
  alias base_dex_Challengue_Compensator base_dex
  def base_dex
    # Gets normal atribute
    n = base_dex_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:dex] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:dex]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:dex]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:dex] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:dex]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:dex]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:dex] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:dex]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:dex]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:dex] != nil
           if effect[:variable] != nil
             total+=effect[:dex]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:dex]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxagi
  #--------------------------------------------------------------------------
  alias base_agi_Challengue_Compensator base_agi
  def base_agi
    # Gets normal atribute
    n = base_agi_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:agi] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:agi]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:agi]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:agi] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:agi]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:agi]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:agi] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:agi]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:agi]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:agi] != nil
           if effect[:variable] != nil
             total+=effect[:agi]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:agi]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxint
  #--------------------------------------------------------------------------
  alias base_int_Challengue_Compensator base_int
  def base_int
    # Gets normal atribute
    n = base_int_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:int] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:int]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:int]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:int] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:int]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:int]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:int] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:int]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:int]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:int] != nil
           if effect[:variable] != nil
             total+=effect[:int]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:int]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxatk
  #--------------------------------------------------------------------------
  alias base_atk_Challengue_Compensator base_atk
  def base_atk
    # Gets normal atribute
    n = base_atk_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:atk] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:atk]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:atk]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:atk] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:atk]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:atk]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:atk] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:atk]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:atk]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:atk] != nil
           if effect[:variable] != nil
             total+=effect[:atk]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:atk]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxpdef
  #--------------------------------------------------------------------------
  alias base_pdef_Challengue_Compensator base_pdef
  def base_pdef
    # Gets normal atribute
    n = base_pdef_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:pdef] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:pdef]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:pdef]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:pdef] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:pdef]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:pdef]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:pdef] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:pdef]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:pdef]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:pdef] != nil
           if effect[:variable] != nil
             total+=effect[:pdef]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:pdef]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxmdef
  #--------------------------------------------------------------------------
  alias base_mdef_Challengue_Compensator base_mdef
  def base_mdef
    # Gets normal atribute
    n = base_mdef_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:mdef] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:mdef]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:mdef]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:mdef] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:mdef]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:mdef]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:mdef] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:mdef]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:mdef]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:mdef] != nil
           if effect[:variable] != nil
             total+=effect[:mdef]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:mdef]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxeva
  #--------------------------------------------------------------------------
  alias base_eva_Challengue_Compensator base_eva
  def base_eva
    # Gets normal atribute
    n = base_eva_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:eva] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:eva]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:eva]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:eva] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:eva]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:eva]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:eva] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:eva]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:eva]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:eva] != nil
           if effect[:variable] != nil
             total+=effect[:eva]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:eva]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxexp
  #--------------------------------------------------------------------------
  alias exp_Challengue_Compensator exp
  def exp
    # Gets normal atribute
    n = exp_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:exp] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:exp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:exp]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:exp] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:exp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:exp]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:exp] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:exp]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:exp]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:exp] != nil
           if effect[:variable] != nil
             total+=effect[:exp]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:exp]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxgold
  #--------------------------------------------------------------------------
  alias gold_Challengue_Compensator gold
  def gold
    # Gets normal atribute
    n = gold_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:gold] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:gold]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:gold]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:gold] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:gold]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:gold]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:gold] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:gold]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:gold]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:gold] != nil
           if effect[:variable] != nil
             total+=effect[:gold]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:gold]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
 
  #--------------------------------------------------------------------------
  # ● Maxdrop
  #--------------------------------------------------------------------------
  alias treasure_prob_Challengue_Compensator treasure_prob
  def treasure_prob
    # Gets normal atribute
    n = treasure_prob_Challengue_Compensator
    # Sets total to a base 100%
    total = 100
    # Search in all effects
    for effect in $game_system.difficulty_effects
         # Effect type 1
         if effect[:active] and effect[:type] == 1  and effect[:drop] != nil and  effect[:enemies_ids].include?(@enemy_id)
           if effect[:variable] != nil
             total+=effect[:drop]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:drop]
           end
         end
         # Effect type 2
         if effect[:active] and effect[:type] == 2  and effect[:drop] != nil and  effect[:maps_ids].include?($game_map.map_id)
           if effect[:variable] != nil
             total+=effect[:drop]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:drop]
           end
         end
         # Effect type 3
         if effect[:active] and effect[:type] == 3  and effect[:drop] != nil and $game_party.tree_includes_map? (effect[:base_map_name])
           if effect[:variable] != nil             
             total+=effect[:drop]*$game_variables[effect[:variable]].to_f/100
           else
             total+=effect[:drop]
           end
         end
         # Effect type 4
         if effect[:active] and effect[:type] == 4 and effect[:drop] != nil
           if effect[:variable] != nil
             total+=effect[:drop]*$game_variables[effect[:variable]]/100
           else
             total+=effect[:drop]
           end
         end
    end
    n = n * total / 100 
    return n.to_i
  end
end

24
RPG Maker Scripts / Warning message(scripters tool)
November 07, 2010, 09:12:46 am
I created this script long ago for one of my menus and any other project. Its very flexible and can be used for a lot of things. It uses a modified window+sprite combination because i think that it looks better, anyway you can modify it or do what you want.

Features:

-The window size and position is based on the text size.
-All other sizes or positions are set automatically.
-It have methods for automatically visible/invisible, dipose,etc, all sprites
and windows.
-You can add a question to it. With this a modified version of a window command
is actived.
-You can changue the text, ask option, x and y in every call.

I use it with a variable in the Scene called "Warning_message_type" that defines the behavior of it.

Note that you need scripting knoledge for using this. Basically im sharing the code for anyone that may need it and don't want to make his own.

If you add something realy cool to it, tell me, the idea is to improve it. Anyway, suggerences,bugs,etc, i will listen for any feedback.

Code: text
#==============================================================================
# Warning message
# By gerkrt/gerrtunk
# Version: 1
# License: GPL, credits
#==============================================================================
=begin

Features:

I created this script long ago for one of my menus and any other project. Its very flexible
and can be used for a lot of things. It uses a modified window+sprite combination
because i think that it looks better, anyway you can modify it or do what you want.

-The window size and position is based on the text size.
-All other sizes or positions are set automatically.
-It have methods for automatically visible/invisible, dipose,etc, all sprites
and windows.
-You can add a question to it. With this a modified version of a window command
is actived.
-You can changue the text, ask option, x and y in every call.

I use it with a variable in the Scene called "Warning_message_type" that defines
the behavior of it.

=end

class Warning_Message
  def initialize
    # Default values when refreshing it
    @default_x = 200
    @default_y = 200
    # Back text window
    @text_window = Window_Base.new(120, 136, 400, 64)
    @text_window.z = 252
    @text_window.visible = false
    # Text sprite
    @text_sprite = Sprite.new
    @text_sprite.z = 254
    @text_sprite.x = 120
    @text_sprite.y = 136
    @text_sprite.bitmap = Bitmap.new(400,64)
    # Testing bitmap for size test
    @testing_bitmap =  Bitmap.new(1,1)
    # Question window
    @question_window = Window_Selection.new(80, ["Yes", "No"])
    @question_window.x = 280
    @question_window.y = 200
    @question_window.z = 253
    @question_window.back_opacity = 0
    @question_window.opacity = 0
    @question_window.active = false
    @question_window.visible = false
    # Back question window
    @back_question_window = Window_Base.new(120, 136, 64, 64)
    @back_question_window.x = 280
    @back_question_window.y = 200
    @back_question_window.z = 254
    @back_question_window.visible = false

  end
 
  # Make all the sprites/windows visibles
  def visible
    @text_window.visible = true
    @text_sprite.visible = true
    # Question ones only if active
    if @back_question_window.active
      @question_window.visible = true
      @back_question_window.visible = true
    end
  end
 
  # Make all the sprites/windows invisibles
  def no_visible
    @text_window.visible = false
    @text_sprite.visible = false
    @question_window.visible = false
    @back_question_window.visible = false
  end
 
  # Is question window active?
  def active
    return @question_window.active
  end
 
  # Set question window active
  def active=(value)
    @question_window.active = value
  end
 
  # Update all the sprites/windows visibles
  def update
    @text_window.update
    @text_sprite.update
    @back_question_window.update
    @question_window.update
  end
 
  # Draw the warning message
  # question: called to add a yes/no window.
  def refresh(message, question=true, x=@default_x, y=@default_y)
    # Basic position settings
    @text_window.y = y
    @text_window.x = x
    @text_sprite.x = x
    @text_sprite.y = y
    rect = @testing_bitmap.text_size(message)
    # With question window or not. All the positions auto-setting are done here.
    if question
      @text_window.width = rect.width+26+40
      @question_window.visible = true
      @question_window.active = true
      @back_question_window.visible = true
      @question_window.x = @text_window.x+rect.width+4+6
      @question_window.y = @text_window.y - 16
      @back_question_window.x = @text_window.x+rect.width+4+16
      @back_question_window.y = @text_window.y
    else
      @text_window.width = rect.width+26
    end
    # First update the back window
    @text_window.update
    @text_sprite.bitmap.clear
    # Draw text
    @text_sprite.bitmap.draw_text(0+10,0,400,64,message, 0)
    @text_sprite.update
  end
 
  # Dispose all the sprites/windows visibles
  def dispose
    @text_window.dispose
    @text_sprite.dispose
    @question_window.dispose
    @back_question_window.dispose
  end
end


class Window_Selection < Window_Command
   #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = (self.width / @column_max - 32)+11
    # Calculate cursor coordinates
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * 32 - self.oy
    # Update cursor rectangle
    self.cursor_rect.set(x-4, y, cursor_width, 32)
  end

end

25
RMXP Script Database / [XP] Improved Shop
November 07, 2010, 09:12:09 am
Improved shop
Authors: gerrtunk
Version: 2
Type: Misc System
Key Term: Custom Shop System



Introduction
This script add a lost feature from old rpgmakers: the option to select if you
wanted to buy, sell or both.

Also adds the option of modifing the price based in %. Buy and sell discount are
separated, so you can make any combination.

In 2.0, you can define any currency to use for shop(exp, gold, variable...) and
add items that if you cant add to your inventory and that modifiy a switch,
variable or call a common event.

Using this feature you can create easily any set of shops that tells skills or sells
specialized things, or whatever you need, with autocalled common events and
custom currencys, and some extra features.



Features

Classic feature: the option to select if you wanted to buy, sell or both.
Prices modifications for selling and buying

Shops interfaces: You can make any number of different shops interface and
a default one, and then changue all values for they:
 -Gold type by total exp, gold or variable.
 -Gold name.
 -Customizte the used commands buy, sell, exit and his names.
 -Option to not show numbers or select item number
 -Option to exit when a buy is done
 -Windowskin
 -Title/Introduction
 
Special things: These items are special exceptions, where you can define
some unique behaviors:
 -Actor & class buy restrictions
 -Active switch, modifiy variable or call common evenet when buyed
 -Switch that define if can buy or not a thing and other for things that when
   adquired cant be used more.



Screenshots




Demo
http://www.megaupload.com/?d=DW5CMJ16


Script

Spoiler: ShowHide
[
=begin
#==============================================================================
# Improved Shop
# By gerkrt/gerrtunk
# Version: 2.0
# License: GPL, credits
#==============================================================================

This script add a lost feature from old rpgmakers: the option to select if you
wanted to buy, sell or both.

Also adds the option of modifing the price based in %. Buy and sell discount are
separated, so you can make any combination.

In 2.0, you can define any currency to use for shop(exp, gold, variable...) and
add items that if you cant add to your inventory and that modifiy a switch,
variable or call a common event.

Using this feature you can create easily any set of shops that tells skills or sells
specialized things, or whatever you need, with autocalled common events and
custom currencys, and some extra features.

-------FULL FEATURES-------------

Classic feature: the option to select if you wanted to buy, sell or both.
Prices modifications for selling and buying

Shops interfaces: You can make any number of different shops interface and
a default one, and then changue all values for they:
 -Gold type by total exp, gold or variable.
 -Gold name.
 -Customizte the used commands buy, sell, exit and his names.
 -Option to not show numbers or select item number
 -Option to exit when a buy is done
 -Windowskin
 -Title/Introduction
 
Special things: These items are special exceptions, where you can define
some unique behaviors:
 -Actor & class buy restrictions
 -Active switch, modifiy variable or call common evenet when buyed
 -Switch that define if can buy or not a thing and other for things that when
   adquired cant be used more.
 
--------DISCOUNTS, TYPE AND GOLD TYPE---------

Before calling a shop, call this script:

$game_temp.type = 1
$game_temp.buy_discount = 1.2
$game_temp.sell_discount = 0.8
$game_temp.gold_type = :gold

These is a call example.
$game_temp.type : When 2 player can only sell.  When 1 player can only buy. When 0
can do both. Note that this ONLY works with default interface or the interfaces
that have the 3 commands.
$game_temp.buy_discount : When you buy items the price is multiplied with this number.
$game_temp.sell_discount : When you sell items the price is multiplied with this number.

Note that 0.2 , the . is like a ,.

After the sop call, these values are restored to default ones. This means that
you can call a shop wiyhout adding the script call and that it will use:

Type = Buy & Sell
Buy & Sell discounts = 1

As a final option, you can put the discount or type using the values of
a event variable calling this script:

v = $game_variables[1]
$game_temp.sell_discount = v

or whatever type, buy, etc. This way its settled the value of the var 1 to that

--------CUSTOM SHOPS---------
The main idea of these options is that you can create or configurate the normal
shop to do some special things, for example:

-A travel shop that when you exit, you travel automatically. You have the code
in the configuration already. Just call a shop with items 5,6,7,8 and changuing
the interface to :travel


-----INTERFACES------
A shop interface defines some basic things used in some shop. For example, the
currency type used, the vocabulary of the commands, etc. In this way, you can use
a different interface for each thing.

To add a interface paste the code each time:
   :travel => {
     :gold_type => [:var, 6],
     :gold_word => 'Potatos',
     :commands_used => [[:buy, 'Travel'], [:exit, 'Exit']],
     :dont_show_number => true,
     :exit_when_buy => false,    
     :windowskin => 'greenieskin',
     :title => 'Travel merchant: Where you want to go?'
   },

Where the :travel is a unique code used each time, and just respect the sintax
with the , {}, etc.

gold type: The currency used. Can be :gold, normal gold, :exp, will sum all party
actors exp and use it as his gold, and :var. var means that the gold value is
setted using a event variable you control, so, you can create any custom gold.

Note that for variables the syntax is different: [:var, 6], where 6 is the variable
id.

gold word: The word used in the money window of the shop.

commands used: Using this you can customitze a shop to be what you want. What you
do here is define the commands of the shop and the name thats drawn in the game.
The posibles commands codes to configure are :buy, :sell, :exit.  
Then what you have to do is to add any of the three to the list, thats limited
in the []:
 [[:code, 'name'], [:code2, 'name2'], [:code3, 'name3'], ]


dont_show_number: Use this if you dont want to show or select the item number and
it will buy automatically 1. It cant be used when selling.

:exit_when_buy: This make than when you buy the first item, the shop automatically
closes, so, you can only buy or active a single thing.

windowskin : special windowskin used for all the windows

title  : text used for the description or introduction of a shop

To call a interface just use this call script:
$game_temp.shop_interface = :travel
Where travel is the interface name you write, that have to be new each time.
After the shop call, interface selection is reseted to default.

Note that exist a default interface. This is called always when no explicit interface
has been declared.

Finally you can desactive any option making they => false

-----SPECIAL THINGS----
Special things are items that are a exception from normal ones, that will work like
always. You have to use special things in order to create for example a skill learn
shop where each of his items call a common event and that event have a 'learn X skill'
in it.

Note althought that exist A LOT of options that you can use to create your custom.  

Finally, you can use special things only with buy options.

shops:
   # South Amband
   5 => {
     # variable di, valor
     :variable => [2,10],
     :switch => 1,
     :switch_can_buy => 5,
     :common_event => 1,
     :switch_adquired => nil,
     :can_be_adquired_by_class => false,
     :can_be_adquired_by_actor => [1],
     },
     
variable: this makes that when you buy that item, the variable X its added the Z
value, where: [X,Z],

switch: active switch of id 1 when buyed

switch_can_buy: the switch that have to be active to can buy the item

common_event: common event id called when buy. Using this you can call a script
call in it or whatever you want!

switch_adquired: when this switch is active, the thing cant be buyed more. Use it
for things that you want to buy only 1 time.

can_be_adquired_by_class: List of classes that can buy this item. Note that
it will search for a all the party actors. [id1, id2, id3]

can_be_adquired_by_actor: List of actors that can buy this item. Note that
it will search for a all the party actors. [id1, id2, id3]

Desactivating that options: Put they to  => false. Then they wont do a thing.

The syntax to add more things is:

   # New comment
   23 => {
     # variable di, valor
     :variable => [2,10],
     :switch => 1,
     :switch_can_buy => 5,
     :common_event => 1,

     :switch_adquired => nil,
     :can_be_adquired_by_class => false,
     :can_be_adquired_by_actor => [1],
     },

Where the 23 is the item id you want to use as a special thing, and the
# New comment the textthat you can modify to organitze the configuration(just dont
erase the #!).

Each time copy paste this, using a , as a separator and mantaining the starting
and final {] of the general and each thing config.


=end



module Wep
 
 # Custom interfaces
 Shop_interfaces = {
   :travel => {
     :gold_type => [:var, 6],
     :gold_word => 'Potatos',
     :commands_used => [[:buy, 'Travel'], [:exit, 'Exit']],
     :dont_show_number => true,
     :exit_when_buy => true,
     :windowskin => false,
     :title => 'Travel merchant: Where you want to go?'
   },
   
    # Its called when no interface specified. Traditional one.
   :default => {
     :gold_type => :gold,
     :gold_word => 'Gold',
     :commands_used => [[:buy, 'Buy'], [:sell, 'Sell'], [:exit, 'Exit']],
     :dont_show_number => false,
     :exit_when_buy => false,
     :windowskin => false,
     :title => false
   
  }
 
 }
 
 # Things to use
 Things = {

   # South Amband
   5 => {

     :variable => [2,10],
     :switch => 1,
     :switch_can_buy => 5,
     :common_event => 1,
     :switch_adquired => false,
     :can_be_adquired_by_class => false,
     :can_be_adquired_by_actor => [1],
     },
     
   # Fantastica  
   6 => {
     :variable => [2,10],
     :switch => 1,
     :switch_can_buy => 5,
     :common_event => 1,
     :switch_adquired => false,
     :can_be_adquired_by_class => [1],
     :can_be_adquired_by_actor => [1],
     },
     
   # Ridinia
   7 => {
     :variable => [2,10],
     :switch => 1,
     :switch_can_buy => 5,
     :common_event => 1,
     :switch_adquired => false,
     :can_be_adquired_by_class => [1],
     :can_be_adquired_by_actor => [1],
     },
     
   # Wepcondia
   8 => {
     :variable => [2,10],
     :switch => 1,
     :switch_can_buy => 5,
     :common_event => 1,
     :switch_adquired => false,
     :can_be_adquired_by_class => [1],
     :can_be_adquired_by_actor => [1],
     },
   }
   
end


#==============================================================================
# ** Window_ShopBuy
#------------------------------------------------------------------------------
#  This window displays buyable goods on the shop screen.
#==============================================================================

class Window_ShopBuy < Window_Selectable
 
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
   @data = []
   for goods_item in @shop_goods
     case goods_item[0]
     when 0
       item = $data_items[goods_item[1]]
     when 1
       item = $data_weapons[goods_item[1]]
     when 2
       item = $data_armors[goods_item[1]]
     end
     
     if item != nil
       # Only push the ones that arent adquired and if item
       if item.is_a? RPG::Item and Wep::Things[item.id] != nil and
         Wep::Things[item.id][:switch_adquired] != false and
           $game_switches[Wep::Things[item.id][:switch_adquired]]
       
       # Or if the switch to buy isnt active
       elsif item.is_a? RPG::Item and Wep::Things[item.id] != nil and
         Wep::Things[item.id][:switch_can_buy] != false and not
           $game_switches[Wep::Things[item.id][:switch_can_buy]]
       
       else
         @data.push(item)
       end
     end
   end
   
   # If item count is not 0, make a bit map and draw all items
   @item_max = @data.size
   if @item_max > 0
     self.contents = Bitmap.new(width - 32, row_max * 32)
     for i in 0...@item_max
       draw_item(i)
     end
   end
 end
 
 #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #--------------------------------------------------------------------------
 def draw_item(index)
   item = @data[index]
   # Get items in possession
   case item
   when RPG::Item
     number = $game_party.item_number(item.id)
   when RPG::Weapon
     number = $game_party.weapon_number(item.id)
   when RPG::Armor
     number = $game_party.armor_number(item.id)
   end
   # If price is less than money in possession, and amount in possession is
   # not 99, then set to normal text color. Otherwise set to disabled color
   if item.price * $game_temp.buy_discount  <= $game_party.shop_gold and number < 99
     self.contents.font.color = normal_color
   else
     self.contents.font.color = disabled_color
   end
   
   
   rebajado = item.price * $game_temp.buy_discount
   rebajado = rebajado.to_i
   

   x = 4
   y = index * 32
   rect = Rect.new(x, y, self.width - 32, 32)
   self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
   bitmap = RPG::Cache.icon(item.icon_name)
   opacity = self.contents.font.color == normal_color ? 255 : 128
   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
   self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
 

   # When dont show numbers, number more to the right
   if $game_temp.act_shop_interface[:dont_show_number]
     self.contents.draw_text(x + 480, y, 88, 32, rebajado.to_s, 2)
   else
     self.contents.draw_text(x + 240, y, 88, 32, rebajado.to_s, 2)
   end
   
 end
end



#==============================================================================
# ** Window_ShopCommand
#------------------------------------------------------------------------------
#  This window is used to choose your business on the shop screen.
#==============================================================================

class Window_ShopCommand < Window_Selectable
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(0, 64, 480, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   
   @column_max = 3
   #Excepciones de tipo
   cums = Wep::Shop_interfaces[$game_temp.shop_interface][:commands_used]

   # Make custom commmands
   @commands = []
   for cu in cums
     @commands.push cu[1]
   end
   
   @item_max = @commands.size
   
   refresh
   self.index = 0
 end
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
   for i in 0...@item_max
     draw_item(i)
   end
 end
 #--------------------------------------------------------------------------
 # * Draw Item
 #     index : item number
 #--------------------------------------------------------------------------
 def draw_item(index)
   x = 4 + index * 160
     #Excepciones de tipo
   case $game_temp.type
     when 1
       #Canvio de color de fuente y retorno de la misma
       if index == 1
         self.contents.font.color = disabled_color
       end
     
       if index == 2
         self.contents.font.color = normal_color
       end
       
     
     when 2
       #Canvio de color de fuente y retorno de la misma
       if index == 0
         self.contents.font.color = disabled_color
       end
       if index == 1...2
         self.contents.font.color = normal_color
       end
   end
  #p @commands, index
   self.contents.draw_text(x, 0, 128, 32, @commands[index])
 end
end



class Scene_Shop

 #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # Make help window
   @help_window = Window_Help.new
   # Make command window
   @command_window = Window_ShopCommand.new
   # Make gold window
   @gold_window = Window_GoldShop.new
   @gold_window.x = 480
   @gold_window.y = 64
   # Make dummy window
   @dummy_window = Window_Base.new(0, 128, 640, 352)
   # Make buy window
   @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
   @buy_window.active = false
   @buy_window.visible = false
   @buy_window.help_window = @help_window
   # Make sell window
   @sell_window = Window_ShopSell.new
   @sell_window.active = false
   @sell_window.visible = false
   @sell_window.help_window = @help_window
   # Make quantity input window
   @number_window = Window_ShopNumber.new
   @number_window.active = false
   @number_window.visible = false
   # Make status window
   @status_window = Window_ShopStatus.new
   @status_window.visible = false
   # If dont show number
   if Wep::Shop_interfaces[$game_temp.shop_interface][:dont_show_number]
     @number_window.visible = false
     @status_window.visible = false
     @buy_window.width = 640
     @buy_window.z = @status_window.z + 80
   end
   
   # Windoskin
   if Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin]
     @sell_window.windowskin = RPG::Cache.windowskin( Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin])
     @number_window.windowskin = RPG::Cache.windowskin( Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin])
     @status_window.windowskin = RPG::Cache.windowskin( Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin])
     @buy_window.windowskin = RPG::Cache.windowskin( Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin])
     @help_window.windowskin =  RPG::Cache.windowskin( Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin])
     @gold_window.windowskin =  RPG::Cache.windowskin( Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin])
     @command_window.windowskin =  RPG::Cache.windowskin( Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin])
     @dummy_window .windowskin =  RPG::Cache.windowskin( Wep::Shop_interfaces[$game_temp.shop_interface][:windowskin])
   end
 
   # Execute transition
   Graphics.transition
   # Main loop
   loop do
     # Update game screen
     Graphics.update
     # Update input information
     Input.update
     # Frame update
     update
     # Abort loop if screen is changed
     if $scene != self
       break
     end
   end
   # Prepare for transition
   Graphics.freeze
   # Dispose of windows
   @help_window.dispose
   @command_window.dispose
   @gold_window.dispose
   @dummy_window.dispose
   @buy_window.dispose
   @sell_window.dispose
   @number_window.dispose
   @status_window.dispose
 end
 
 #--------------------------------------------------------------------------
 # * Frame Update (when command window is active)
 #--------------------------------------------------------------------------
 def update_command
   # Set title
   if Wep::Shop_interfaces[$game_temp.shop_interface][:title]
     @help_window.set_text (Wep::Shop_interfaces[$game_temp.shop_interface][:title])
   end
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
       # Reset shop variables
       $game_temp.type = 0
       $game_temp.buy_discount = 1
       $game_temp.sell_discount = 1
       $game_temp.shop_interface = :default
     # Switch to map screen
     $scene = Scene_Map.new
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Trasnlate command index as command code used
     case $game_temp.act_shop_interface[:commands_used][@command_window.index][0]
     
       when :buy
         command_buy
       when :sell
         command_sell
       when :exit
         command_exit
       
     return
    end
   end
 end
 
 #--------------------------------------------------------------------------
 # * Command buy: execute command buy
 #--------------------------------------------------------------------------
 def command_buy
       if $game_temp.type== 0 or $game_temp.type== 1
         # Play decision SE
         $game_system.se_play($data_system.decision_se)
         # Change windows to buy mode
         @command_window.active = false
         @dummy_window.visible = false
         @buy_window.active = true
         @buy_window.visible = true
         @buy_window.refresh
         @status_window.visible = true
       else
         $game_system.se_play($data_system.cancel_se)
         return
       end  
 end
     
 #--------------------------------------------------------------------------
 # * Command sell: execute command sell
 #--------------------------------------------------------------------------  
 def command_sell
     if $game_temp.type== 0 or $game_temp.type== 2
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Change windows to sell mode
       @command_window.active = false
       @dummy_window.visible = false
       @sell_window.active = true
       @sell_window.visible = true
       @sell_window.refresh
     else
       $game_system.se_play($data_system.cancel_se)
       return
     end
 end

 #--------------------------------------------------------------------------
 # * Command exit: execute command exit
 #--------------------------------------------------------------------------
 def command_exit
       # Play decision SE
       $game_system.se_play($data_system.decision_se)
       # Reset shop variables
       $game_temp.type = 0
       $game_temp.buy_discount = 1
       $game_temp.sell_discount = 1
       $game_temp.shop_interface = :default
       # Switch to map screen
       $scene = Scene_Map.new
 end
     
 #--------------------------------------------------------------------------
 # * Check item class restriction
 #--------------------------------------------------------------------------  
 def item_class_restriction
     # If its special one and cant be purchased by actors or classes
     if Wep::Things[@item.id] != nil
        class_valid = true

        if Wep::Things[@item.id][:can_be_adquired_by_class]
          for adq_class in Wep::Things[@item.id][:can_be_adquired_by_class]
            class_valid = false unless $game_party.include_class?(adq_class)
          end
        end
       
        unless class_valid
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return false
        end
       
      end
      return true
 end
 
 #--------------------------------------------------------------------------
 # * Check item actor restriction
 #--------------------------------------------------------------------------    
 def item_actor_restriction
     # If its special one and cant be purchased by actors or classes
     if Wep::Things[@item.id] != nil
        actor_valid = true
        if Wep::Things[@item.id][:can_be_adquired_by_actor]
          for adq_actor in Wep::Things[@item.id][:can_be_adquired_by_actor]
            actor_valid = false unless $game_party.include_actor?(adq_actor)
          end
        end
       
        unless actor_valid
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return false
        end
       
       
     end
      return true
 end

 #--------------------------------------------------------------------------
 # * Frame Update (when buy window is active)
 #--------------------------------------------------------------------------
 def update_buy
   # Set status window item
   @status_window.item = @buy_window.item
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Change windows to initial mode
     @command_window.active = true
     @dummy_window.visible = true
     @buy_window.active = false
     @buy_window.visible = false
     @status_window.visible = false
     @status_window.item = nil
     # Erase help text
     @help_window.set_text("")
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Get item
     @item = @buy_window.item
     # If item is invalid, or price is higher than money possessed
     if @item == nil or @item.price > $game_party.shop_gold
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     
     # If dont show number, automatically gain 1 item and skip number
     if Wep::Shop_interfaces[$game_temp.shop_interface][:dont_show_number]

       # Buy process only if normal
         unless Wep::Things[@item.id] != nil
           modificado = @item.price * $game_temp.buy_discount
           $game_party.shop_lose_gold(modificado.to_i)
           case @item
             when RPG::Item
               $game_party.gain_item(@item.id, 1)
             when RPG::Weapon
               $game_party.gain_weapon(@item.id, 1)
             when RPG::Armor
               $game_party.gain_armor(@item.id, 1)
             end
             
         # Special items
         else


           # Check items restrictions
           return unless item_actor_restriction
           return unless item_class_restriction
           
           modificado = @item.price * $game_temp.buy_discount
           $game_party.shop_lose_gold(modificado.to_i)
           
           # Modifiy var
           if Wep::Things[@item.id][:variable]
             $game_variables[Wep::Things[@item.id][:variable][0]] += Wep::Things[@item.id][:variable][1]
           end
           # Mod sw
           if Wep::Things[@item.id][:switch]
             $game_switches[Wep::Things[@item.id][:switch]] = true
           end
           # Call comm ev
           if Wep::Things[@item.id][:common_event]
             $game_temp.common_event_id = Wep::Things[@item.id][:common_event]
           end
         end
         
         # Refresh each window
         @gold_window.refresh
         @buy_window.refresh
         @status_window.refresh
         # End execution and play se
         # Play decision SE
         $game_system.se_play($data_system.decision_se)
         
         # Or exit if configurated
         if Wep::Shop_interfaces[$game_temp.shop_interface][:exit_when_buy]
           $scene = Scene_Map.new
         end
         return
     end
     

     # Get items in possession count
     case @item
     when RPG::Item
       number = $game_party.item_number(@item.id)
     when RPG::Weapon
       number = $game_party.weapon_number(@item.id)
     when RPG::Armor
       number = $game_party.armor_number(@item.id)
     end
     # If 99 items are already in possession
     if number == 99
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     
     # Play decision SE
     $game_system.se_play($data_system.decision_se)
     # Calculate maximum amount possible to buy
     rebaja = @item.price*$game_temp.buy_discount
     max = @item.price == 0 ? 99 : $game_party.shop_gold / rebaja.to_i
     max = [max, 99 - number].min
     # Change windows to quantity input mode
     @buy_window.active = false
     @buy_window.visible = false
     descuento = @item.price * $game_temp.buy_discount
     @number_window.set(@item, max, descuento.to_i)
     @number_window.active = true
     @number_window.visible = true
   end
 end
 
 #--------------------------------------------------------------------------
 # * Frame Update (when sell window is active)
 #--------------------------------------------------------------------------
 def update_sell
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Change windows to initial mode
     @command_window.active = true
     @dummy_window.visible = true
     @sell_window.active = false
     @sell_window.visible = false
     @status_window.item = nil
     # Erase help text
     @help_window.set_text("")
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Get item
     @item = @sell_window.item
     # Set status window item
     @status_window.item = @item
     # If item is invalid, or item price is 0 (unable to sell)
     if @item == nil or @item.price == 0
       # Play buzzer SE
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     # Play decision SE
     $game_system.se_play($data_system.decision_se)
     # Get items in possession count
     case @item
     when RPG::Item
       number = $game_party.item_number(@item.id)
     when RPG::Weapon
       number = $game_party.weapon_number(@item.id)
     when RPG::Armor
       number = $game_party.armor_number(@item.id)
     end
     # Maximum quanitity to sell = number of items in possession
     max = number
     # Change windows to quantity input mode
     @sell_window.active = false
     @sell_window.visible = false
     descuento = (@item.price * $game_temp.vend_desc) / 2
     @number_window.set(@item, max, descuento.to_i)
     @number_window.active = true
     @number_window.visible = true
     @status_window.visible = true
   end
 end
 
 #--------------------------------------------------------------------------
 # * Frame Update (when quantity input window is active)
 #--------------------------------------------------------------------------
 def update_number
   # If B button was pressed
   if Input.trigger?(Input::B)
     # Play cancel SE
     $game_system.se_play($data_system.cancel_se)
     # Set quantity input window to inactive / invisible
     @number_window.active = false
     @number_window.visible = false
     # Branch by command window cursor position
     case @command_window.index
     when 0  # buy
       # Change windows to buy mode
       @buy_window.active = true
       @buy_window.visible = true
     when 1  # sell
       # Change windows to sell mode
       @sell_window.active = true
       @sell_window.visible = true
       @status_window.visible = false
     end
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Play shop SE
     $game_system.se_play($data_system.shop_se)
     # Set quantity input window to inactive / invisible
     @number_window.active = false
     @number_window.visible = false
     # Branch by command window cursor position
     case @command_window.index
     when 0  # buy
       
       # Buy process only if normal
       unless Wep::Things[@item.id] != nil
         modificado = @number_window.number * @item.price * $game_temp.buy_discount
         $game_party.shop_lose_gold(modificado.to_i)
         case @item
           when RPG::Item
             $game_party.gain_item(@item.id, @number_window.number)
           when RPG::Weapon
             $game_party.gain_weapon(@item.id, @number_window.number)
           when RPG::Armor
             $game_party.gain_armor(@item.id, @number_window.number)
           end
           
       # Special items
       else
   
         # Check items restrictions
         return unless item_actor_restriction
         return unless item_class_restriction
         
         modificado = @number_window.number * @item.price * $game_temp.buy_discount
         $game_party.shop_lose_gold(modificado.to_i)
         
         # Modifiy var
         if Wep::Things[@item.id][:variable]
           $game_variables[Wep::Things[@item.id][:variable][0]] += Wep::Things[@item.id][:variable][1]
         end
         # Mod sw
         if Wep::Things[@item.id][:switch]
           $game_switches[Wep::Things[@item.id][:switch]] = true
         end
         # Call comm ev
         if Wep::Things[@item.id][:common_event]
           $game_temp.common_event_id = Wep::Things[@item.id][:common_event]
         end
       end
       
       # Refresh each window
       @gold_window.refresh
       @buy_window.refresh
       @status_window.refresh
       # Change windows to buy mode
       @buy_window.active = true
       @buy_window.visible = true
       
       # Or exit if configurated
       if Wep::Shop_interfaces[$game_temp.shop_interface][:exit_when_buy]
         $scene = Scene_Map.new
       end
     when 1  # sell
       # Sell process
       modificado = (@item.price * $game_temp.vend_desc) / 2
       $game_party.shop_gain_gold(@number_window.number * modificado.to_i)
       case @item
       when RPG::Item
         $game_party.lose_item(@item.id, @number_window.number)
       when RPG::Weapon
         $game_party.lose_weapon(@item.id, @number_window.number)
       when RPG::Armor
         $game_party.lose_armor(@item.id, @number_window.number)
       end
       # Refresh each window
       @gold_window.refresh
       @sell_window.refresh
       @status_window.refresh
       # Change windows to sell mode
       @sell_window.active = true
       @sell_window.visible = true
       @status_window.visible = false
     end
     return
   end
 end

end

 
class Game_Temp
 attr_accessor :type                        # 2: Sell/1: Buy/0: Both
 attr_accessor :buy_discount                # Buy discount +- %
 attr_accessor :sell_discount               # Sell discount +- %
 attr_accessor :shop_interface                  # Sell discount +- %  
 alias gt_init initialize
 def initialize
     gt_init
     @type = 0
     @shop_interface = :default
     @buy_discount = 1
     @sell_discount = 1
 end
 
 # Return shop interface
 def act_shop_interface
   Wep::Shop_interfaces[$game_temp.shop_interface]
 end
end

class Game_Actor
 attr_reader     :actor_id
end

class Game_Party
   
 #--------------------------------------------------------------------------
 # * Seeks if at least a actor in the party have the actor id
 #--------------------------------------------------------------------------
   def include_actor?(id)
     f=false
     for a in @actors
       f=true if a.actor_id == id
     end
     f
   end
   
 #--------------------------------------------------------------------------
 # * Seeks if at least a actor in the party have the class id
 #--------------------------------------------------------------------------  
   def include_class?(id)
     f=false
     for a in @actors
       f=true if a.class_id == id
     end
     f
   end

 #--------------------------------------------------------------------------
 # * Shop gold
 #     gold method used only in shop
 #--------------------------------------------------------------------------
 def shop_gold
   type = Wep::Shop_interfaces[$game_temp.shop_interface][:gold_type]
   # Normal gold
   if type == :gold
     return @gold
   # Experience
   elsif type == :exp
     v = 0
     @actors.each {|a| v += a.exp}
     return v
   # Event variable
   else
     return $game_variables[Wep::Shop_interfaces[$game_temp.shop_interface][:gold_type][1]]
   end
 end
 
 #--------------------------------------------------------------------------
 # * Shop Gain Gold (or lose)
 #     n : amount of gold
 #--------------------------------------------------------------------------
 def shop_gain_gold(n)
   type = Wep::Shop_interfaces[$game_temp.shop_interface][:gold_type]
   # Normal gold
   if type == :gold
     @gold = [[@gold + n, 0].max, 9999999].min
     
   # Experience
   elsif type == :exp
     # Divide actor number by n
     ratio = (n/@actors.size).to_i
     # Modify each exp
     @actors.each {|a| a.exp += ratio}
     
   # Event variable
   else
     vid = Wep::Shop_interfaces[$game_temp.shop_interface][:gold_type][1]
     $game_variables[vid] = [[$game_variables[vid] + n, 0].max, 9999999].min
   end
   
   
 end
 
 #--------------------------------------------------------------------------
 # * Shop Lose Gold
 #     n : amount of gold
 #--------------------------------------------------------------------------
 def shop_lose_gold(n)
   # Reverse the numerical value and call it gain_gold
   shop_gain_gold(-n)
 end
 
end



#==============================================================================
# ** Window_GoldShop
#------------------------------------------------------------------------------
#  This window displays amount of gold in shops
#==============================================================================

class Window_GoldShop < Window_Base
 #--------------------------------------------------------------------------
 # * Object Initialization
 #--------------------------------------------------------------------------
 def initialize
   super(0, 0, 160, 64)
   self.contents = Bitmap.new(width - 32, height - 32)
   refresh
 end
 
 #--------------------------------------------------------------------------
 # * Refresh
 #--------------------------------------------------------------------------
 def refresh
   self.contents.clear
     word = Wep::Shop_interfaces[$game_temp.shop_interface][:gold_word].to_s
     cx = contents.text_size(word).width
     self.contents.font.color = normal_color
     self.contents.draw_text(4, 0, 120-cx-2, 32, $game_party.shop_gold.to_s, 2)
     
     self.contents.font.color = system_color
     self.contents.draw_text(124-cx, 0, cx, 32, word, 2)
 
 end
end



module Wep
 Scripts_list = [] unless defined? Scripts_list
 Scripts_list.push ('Improved Shop')
end




Instructions
In the script.


Compatibility
Any other shop script.


Credits and Thanks
No.


Author's Notes

I will add more things when i need them in my projects(or i have time), so it will be updated. Again, feedback, bugs,retc, i will listen.
26
RPG Maker Scripts / Restricted use and apply items
November 07, 2010, 09:10:14 am
This script adds a lost feature from old rpgmakers: the option to create item use restrictions by actor or class. Also now dead actors cant be valid users of items.

Also adds a new feature: option to decide what actors can be the target of a item and the option to view it visually when selecting the targets.

In development. Bugs, suggerences, compatibality, etc

Code: text
#==============================================================================
# Restricted use and apply items
# By gerkrt/gerrtunk
# Version: 1.1
# License: GPL, credits
#==============================================================================
=begin

This script adds a lost feature from old rpgmakers: the option to create item use
restrictions by actor or class. Also now dead actors cant be valid users of items.

Also adds a new feature: option to decide what actors can be the target of
a item and the option to view it visually when selecting the targets.

--------Use Restriction-----------

This system gives you the option to decide what actors can use a item.

Instructions:

Restricted_items = {1 => [2,6],2 => [1,2]}

If you wanted to add a use restriction for item 5 and that it can only be used
to actors 5 and 7:

Restricted_items = {1 => [2,6],2 => [1,2], 5=>[5,7] }

item_id => [actor_id, actor_id2, actor_idx]

Note that you can remove the examples:

Restricted_items = {5=>[5,7]}

Notes about the usage:

-The ids you add define only the actors that can use the items, the rest cant do that.

-Items that you dont add to the Restricted_items list will be treated like
normal ones(no restrictions)

Options(true= active, false= inactive):

Dead_cant_use: Imagine that you have a item restricted only for actor 1, who is dead.
With this option enabled the item cant be used in the main menu.

---------Apply Restriction----------

This system gives you the option to decide what actors can be the target of a item.

Instructions:

Restricted_aplication = {1 => [2,6],2 => [1,2]}

If you wanted to add a apply restriction for item 5 and that it can only be applied
to actors 5 and 7:

Restricted_aplication = {1 => [2,6],2 => [1,2], 5=>[5,7] }

item_id => [actor_id, actor_id2, actor_idx]

Note that you can remove the examples:

Restricted_aplication = {5=>[5,7]}

Notes about the usage:

-The ids you add define only the actors that can be target, the rest cant do that.

-All members items effects: The effect will be applied to all members except wich
cant be applied. If nobody can be target, the item cant be used.

-Single target effects: Only to that can.

-Items that you dont add to the Restricted_aplication list will be treated like
normal ones(no restrictions)

Options(true= active, false= inactive):

Use_is_Aplication: This make that use restictions and apply restrctions are the same.
This means that only an actor that can use an item can be target of it. If you active
it all the options defined in Restricted_aplication will be ignored.

Active_restricted_aplication: This is a compatibality option. The apply script
modifies a lot of things, so, is possible that it will be incompatible. Then you
might want to turn off this option, because you still want to use restricted
normal items. Note that you will lose all its functions.

Show_application_battle_grafic: Another compatibality option. This makes that the
actor name is printed in disabled color in the battle. If dont work or use another
system, desactive it.

Show_application_item_grafic: Another compatibality option. This makes that the
actor name is printed in disabled color in the item menu. If dont work or use another
system, desactive it.

----------Restrictions based on Classes-------

The method of adding is the same that in the others.Just add a Class_ before the variable
name to know what is. Anyway you must know that an
actor restriction have preference over clases restrictions. This means that a
actor that can use restricted item also can use that item with any class. If the
actor cant use the item then class rectictions are checked.

----------Tip for long lines-------------

After every , you can make a new line. Example:

Restricted_aplication = {1 => [2,6],2 => [1,2], 5=>[5,7],
7 => [2,6],9 => [1,2], 13=>[5,7]}

=end

module Wep
    #            {Item_id => [actor_id]}
    Restricted_items = {2 => [1]}
    Class_restricted_items = {2 => [1]}
    Active_restricted_aplication = true
    Use_is_Aplication = false
    Show_application_battle_grafic = true
    Show_application_item_grafic = true
    Restricted_aplication = {2 => [4,1]}
    Class_restricted_aplication = {2 => [2]}
    Dead_cant_use = true
end

# RESTRICTED APLICATION CODE
if Wep::Active_restricted_aplication

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Make Item Action Results
  #--------------------------------------------------------------------------
  def make_item_action_result
    # Get item
    @item = $data_items[@active_battler.current_action.item_id]
    # If unable to use due to items running out
    unless $game_party.item_can_use?(@item.id)
      # Shift to step 1
      @phase4_step = 1
      return
    end
    # If consumable
    if @item.consumable
      # Decrease used item by 1
      $game_party.lose_item(@item.id, 1)
    end
    # Display item name on help window
    @help_window.set_text(@item.name, 1)
    # Set animation ID
    @animation1_id = @item.animation1_id
    @animation2_id = @item.animation2_id
    # Set common event ID
    @common_event_id = @item.common_event_id
    # Decide on target
    index = @active_battler.current_action.target_index
    target = $game_party.smooth_target_actor(index)
    # Set targeted battlers
    set_target_battlers(@item.scope)
    # Apply item effect
    for target in @target_battlers
      # Check restrictions
      if target.is_a?(Game_Actor) and $game_party.item_can_apply?(@active_battler.current_action.item_id, target.actor_id_reader)
        target.item_effect(@item)
      end
    end
  end

  #--------------------------------------------------------------------------
  # * Frame Update (actor command phase : actor selection)
  #--------------------------------------------------------------------------
  def update_phase3_actor_select
    # Update actor arrow
    @actor_arrow.update
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # End actor selection
      end_actor_select
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      #p @active_battler.current_action.item_id,  $game_party.actors[@actor_arrow.index].actor_id_reader
      if not $game_party.item_can_apply?(@active_battler.current_action.item_id, $game_party.actors[@actor_arrow.index].actor_id_reader)
        # Play cancel SE
        $game_system.se_play($data_system.cancel_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Set action
      @active_battler.current_action.target_index = @actor_arrow.index
      # End actor selection
      end_actor_select
      # If skill window is showing
      if @skill_window != nil
        # End skill selection
        end_skill_select
      end
      # If item window is showing
      if @item_window != nil
        # End item selection
        end_item_select
      end
      # Go to command input for next actor
      phase3_next_actor
    end
  end

end





class Game_Party
  #--------------------------------------------------------------------------
  # * Determine if Item is Apply
  #     item_id : item ID
  #     actor_id : target actor id
  #--------------------------------------------------------------------------
  def item_can_apply?(item_id, actor_id)
     # If this option is enabled, use restriction information for apply restrictions
     if Wep::Use_is_Aplication
       
      # Actor check
      if Wep::Restricted_items[item_id] != nil and Wep::Restricted_items[item_id][0] != nil
       if Wep::Restricted_items[item_id].include?(actor_id)
          return true
        else
         
      # Actor-Class check
      if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil
       if Wep::Class_restricted_items[item_id].include?($game_actors[actor_id].class_id)
         
          return true
        else
          return false
        end
        # If normal item, all true
        return true
      end

         
          # If not class also, false.
          return false
        end
        # If normal item, all true
        return true
      end
     
      # Class only check
      if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil
       if Wep::Class_restricted_items[item_id].include?($game_actors[actor_id].class_id)
          return true
        else
          return false
        end
        # If normal item, all true
        return true
      end
     end
   
     
     # Normal behavior
     
     
     # Actor check
     if Wep::Restricted_aplication[item_id] != nil and Wep::Restricted_aplication[item_id][0] != nil
       if Wep::Restricted_aplication[item_id].include?(actor_id)
          return true
        else
         
      # Actor-Class check
      if Wep::Class_restricted_aplication[item_id] != nil and Wep::Class_restricted_aplication[item_id][0] != nil
       if Wep::Class_restricted_aplication[item_id].include?($game_actors[actor_id].class_id)
          return true
        else
          return false
        end
        # If normal item, all true
        return true
      end
          # If not class also, false. 
          return false
        end
       

      end
     
      # Class check
      if Wep::Class_restricted_aplication[item_id] != nil and Wep::Class_restricted_aplication[item_id][0] != nil
       if Wep::Class_restricted_aplication[item_id].include?($game_actors[actor_id].class_id)
          return true
        else
          return false
        end
        # If normal item, all true
        return true
      end

       
     
      # If normal item, all true
      return true
  end
end


end


# CORE CODE

class Scene_Item 
  #--------------------------------------------------------------------------
  # * Frame Update (when target window is active)
  #--------------------------------------------------------------------------
  def update_target
    if Wep::Show_application_item_grafic
      @target_window.refresh_disabled(@item_window.item.id)
    end
    # If B button was pressed
    if Input.trigger?(Input::B)
     
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # If unable to use because items ran out
      unless $game_party.item_number(@item.id) == 0
        # Remake item window contents
        @item_window.refresh
      end
      # Erase target window
      @item_window.active = true
      @target_window.visible = false
      @target_window.active = false
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If items are used up
      if $game_party.item_number(@item.id) == 0 
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
     

      # If target is all
      if @target_window.index == -1
        # If apply restriction system is active
        if Wep::Active_restricted_aplication
        # First check that at least one actor can take the effect
          for i in $game_party.actors
            if $game_party.item_can_apply?(@item.id, i.actor_id_reader)
              can_apply = true
            end
          end
         # If any can, escape
         if can_apply == nil
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
           return
         end
        # Apply item effects to entire party
        used = false
        for i in $game_party.actors
          # Only apply effects to the actors that can
          if $game_party.item_can_apply?(@item.id, i.actor_id_reader)
            used |= i.item_effect(@item)
          end
        end
       
       # Normal behavior
       else
        # Apply item effects to entire party
        used = false
        for i in $game_party.actors
          used |= i.item_effect(@item)
        end
       
         
       end 
      end
     
     
      # If single target
      if @target_window.index >= 0
       # If apply restriction system is active
       if Wep::Active_restricted_aplication
        unless $game_party.item_can_apply?(@item.id, $game_party.actors[@target_window.index].actor_id_reader)
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
        end
        # Apply item use effects to target actor
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
       # Normal behavior
       else
        # Apply item use effects to target actor
        target = $game_party.actors[@target_window.index]
        used = target.item_effect(@item)
       end
     
      end
       
     
     
      # If an item was used
      if used
        # Play item use SE
        $game_system.se_play(@item.menu_se)
        # If consumable
        if @item.consumable
          # Decrease used items by 1
          $game_party.lose_item(@item.id, 1)
          # Redraw item window item
          @item_window.draw_item(@item_window.index)
        end
        # Remake target window contents
        @target_window.refresh
        # If all party members are dead
        if $game_party.all_dead?
          # Switch to game over screen
          $scene = Scene_Gameover.new
          return
        end
        # If common event ID is valid
        if @item.common_event_id > 0
          # Common event call reservation
          $game_temp.common_event_id = @item.common_event_id
          # Switch to map screen
          $scene = Scene_Map.new
          return
        end
      end
      # If item wasn't used
      unless used
        #p'nmo usado'
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
  end

end

class Scene_Battle
  def actor_id_restricted_item
    return @active_battler.actor_id_reader
  end
end
class Game_Actor < Game_Battler
  def actor_id_reader
    return @actor_id
  end
end
class Game_Party
  #--------------------------------------------------------------------------
  # * Determine if Item is Usable
  #     item_id : item ID actor id batalla? desde scnee?
  #--------------------------------------------------------------------------
  def item_can_use?(item_id)
    # If item quantity is 0
    if item_number(item_id) == 0
      # Unusable
      return false
    end
   
    # Restricted item in map menu

   # If itsnt normal, check for use restriction 
    if Wep::Restricted_items[item_id] != nil and Wep::Restricted_items[item_id][0] != nil and not $game_temp.in_battle
     # Check for dead option
     if Wep::Dead_cant_use
      # Check for at least one living valid actor
      for actor in $game_party.actors
        if Wep::Restricted_items[item_id].include?(actor.id) and actor.hp > 0
            return true
        end
      end
     
           
    # Check for class restrction if actor restriction fails
    if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil and not $game_temp.in_battle
      # Check for dead option
     if Wep::Dead_cant_use
      # Check for at least one living valid actor
      for actor in $game_party.actors
        if Wep::Class_restricted_items[item_id].include?($game_actors[actor.id].class_id) and actor.hp > 0
            return true
        end
      end
      return false
     # If dont check for dead
     else
      # Check for at least one valid actor-class
      for actor in $game_party.actors
        if Wep::Class_restricted_items[item_id].include?($game_actors[actor.id].class_id)
           # At least one valid actor
           return true
        end
      end
       # It dont have valid actors in the party
       return false

     end
   end

     
     # If dont use class or class restriction failed
     return false
     
     # If dont check for dead
     else
      # Check for at least one valid actor
      for actor in $game_party.actors
        if Wep::Restricted_items[item_id].include?(actor.id)
           # At least one valid actor
           return true
        end
      end
       # It dont have valid actors in the party
       return false
     end
     
    end
     
    # Check for only class restriction
    if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil and not $game_temp.in_battle
      # Check for dead option
     if Wep::Dead_cant_use
      # Check for at least one living valid actor
      for actor in $game_party.actors
        if Wep::Class_restricted_items[item_id].include?($game_actors[actor.id].class_id) and actor.hp > 0
            # At least one valid living actor
            return true
        end
      end
      return false if valid_actor_class == nil
     # If dont check for dead
     else
      # Check for at least one valid actor-class
      for actor in $game_party.actors
        if Wep::Class_restricted_items[item_id].include?($game_actors[actor.id].class_id)
           # At least one valid actor
           return true
        end
      end
       # It dont have valid actors in the party
       return false

     end
   end
   
    # All normal items are usable if not in batte
    return true if not $game_temp.in_battle

    # Get usable time
    occasion = $data_items[item_id].occasion
    # If in battle
    if $game_temp.in_battle
      # Check item use restriction
      if Wep::Restricted_items[item_id] != nil and Wep::Restricted_items[item_id][0] != nil
        # Check if usable in battle or not
        if occasion == 0 or occasion == 1
          # Check restrictions
          if Wep::Restricted_items[item_id].include?($scene.actor_id_restricted_item)
            return true
          else
            # Class restrictions(Actor+Class check)
            if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil #and not $game_temp.in_battle
              # Check class restrictions
              if Wep::Class_restricted_items[item_id].include?($game_actors[$scene.actor_id_restricted_item].class_id)
                return true
              end
                return false
            end
          end
        # If not usable in battle
        else
          return false
        end
      end
           

   
     
    # Class restrictions if actor restriction dont exist
    if Wep::Class_restricted_items[item_id] != nil and Wep::Class_restricted_items[item_id][0] != nil and $game_temp.in_battle
     # Check if usable in battle or not
     if occasion == 0 or occasion == 1
      # Check class restrictions
      if Wep::Class_restricted_items[item_id].include?($game_actors[$scene.actor_id_restricted_item].class_id)
        return true
      else
        return false
      end
     # If not usable in battle
     else
      return false
     end
    end
   
   
     # All normal items are usable  in battle based on their occasion
     
      # If useable time is 0 (normal) or 1 (only battle) it's usable
      return (occasion == 0 or occasion == 1)
    end
    # If useable time is 0 (normal) or 2 (only menu) it's usable
    return (occasion == 0 or occasion == 2)
  end


end



# SHOW BATTLE GRAPHICS CODE

if Wep::Show_application_battle_grafic


class Scene_Battle
  #--------------------------------------------------------------------------
  # * Start Actor Selection
  #--------------------------------------------------------------------------
  def start_actor_select
     # Make actor arrow
    @actor_arrow = Arrow_Actor.new(@spriteset.viewport2)
    @actor_arrow.index = @actor_index
    # Associate help window
    @actor_arrow.help_window = @help_window
    # Disable actor command window
    @actor_command_window.active = false
    @actor_command_window.visible = false
    @status_window.refresh_disabled(@active_battler) if @active_battler.current_action.kind == 2
  end
  #--------------------------------------------------------------------------
  # * End Actor Selection
  #--------------------------------------------------------------------------
  def end_actor_select
    @status_window.refresh
    # Dispose of actor arrow
    @actor_arrow.dispose
    @actor_arrow = nil
  end
end

class Window_BattleStatus < Window_Base

  #--------------------------------------------------------------------------
  # * Refresh Disabled
  #--------------------------------------------------------------------------
  def refresh_disabled(active_battler)
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      actor_x = i * 160 + 4
      if not $game_party.item_can_apply?(active_battler.current_action.item_id, $game_party.actors[i].actor_id_reader)
       self.contents.font.color = disabled_color
       self.contents.draw_text(actor_x, 0, 120, 32, actor.name)
      else
         draw_actor_name(actor, actor_x, 0)
      end
      draw_actor_hp(actor, actor_x, 32, 120)
      draw_actor_sp(actor, actor_x, 64, 120)
      if @level_up_flags[i]
        self.contents.font.color = normal_color
        self.contents.draw_text(actor_x, 96, 120, 32, "¡Sube Nivel!")
      else
        draw_actor_state(actor, actor_x, 96)
      end
    end
    self.contents.font.color = normal_color
  end
end

end



# SHOW ITEM GRAPHICS CODE


if Wep::Show_application_item_grafic

#==============================================================================
# ** Window_Target
#------------------------------------------------------------------------------
#  This window selects a use target for the actor on item and skill screens.
#==============================================================================

class Window_Target < Window_Selectable
  #--------------------------------------------------------------------------
  # * Refresh Disabled
  #--------------------------------------------------------------------------
  def refresh_disabled(item_id)
    self.contents.clear
    for i in 0...$game_party.actors.size
      x = 4
      y = i * 116
      actor = $game_party.actors[i]
      if not $game_party.item_can_apply?(item_id, $game_party.actors[i].actor_id_reader)
        self.contents.font.color = disabled_color
        self.contents.draw_text(x, y, 120, 32, actor.name)
      else
        draw_actor_name(actor, x, y)
      end
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x + 8, y + 32)
      draw_actor_state(actor, x + 8, y + 64)
      draw_actor_hp(actor, x + 152, y + 32)
      draw_actor_sp(actor, x + 152, y + 64)
    end
    self.contents.font.color = normal_color
  end
end

end

27
RPG Maker Scripts / Multiusables items
September 20, 2010, 08:09:26 am
This script recovers a function that was in old rpgmakers: creating items with any limited number of uses(not just 0 or unlimited).
Also adds the option to show the uses ratio in the item description.

Under development. Bugs, suggrences, compatibility issues... just ask.

Code: text
#==============================================================================
# Multiusable items
# By gerkrt/gerrtunk
# Version: 1.5
# License: GPL, credits
#==============================================================================
=begin

--------Instructions-----------

Just add new items in the variable Multiusable_items. You have to do this to
add a new item every time.

Ex: If you wanted to add the item number 5 of the database with 3 uses:

Multiusable_items = {1=>3, 3=>2, 5=>3}

First goes the item id, then the uses. Note that you can remove the two examples
i have add:

Multiusable_items = {5=>3}

This works like in old Rpgmakers. Internally it will be used the item with less
number of uses left.

----------Options-------------

Show_uses: If you turn this option on it will add to every multiusable descriptions
the number of uses left, example:

Super Potion
Description: 2/2 uses. Recovers 300 HP.

Uses_text: You can modify here the text that is add before the uses ratio.


----------Compatibality-------------

The show uses option modifies the shop and item menu, if you have some script
that changue that it can give you problems. Turn this option off if something goes
wrong.

=end

module Wep
    # By uses. {Item_id=> number of uses}
    Multiusable_items = {1=>3, 3=>2}
    Show_uses = true
    Uses_text = ' uses. '
end

class Game_Party
   attr_reader :multiusable_items
   alias wep_gm_par_init initialize
   def initialize
     wep_gm_par_init
     @multiusable_items = []
  end

  #--------------------------------------------------------------------------
  # * Gain Items (or lose)
  #     item_id : item ID
  #     n       : quantity
  #--------------------------------------------------------------------------
  def gain_item(item_id, n)
    # Update quantity data in the hash.
    if item_id > 0
     # Check if multiusable
     if multiusable?(item_id) and n > 0
       for i in 0...n
        # Push a new item with uses and item id
        uses = Wep::Multiusable_items[item_id]
        @multiusable_items.push([item_id,uses])
       end
      end
      @items[item_id] = [[item_number(item_id) + n, 0].max, 99].min
    end
  end

  #--------------------------------------------------------------------------
  # * Lose Items
  #     item_id : item ID
  #     n       : quantity
  #--------------------------------------------------------------------------
  def lose_item(item_id, n)
     if multiusable?(item_id) and have_multiusables?(item_id) and not $scene.is_a?(Scene_Shop)
       # Sort by uses
       @multiusable_items.sort! {|a,b|a[1]<=> b[1]}
       # Iterate over all items in search of what have the lowest uses
       i=0
       for item in @multiusable_items
        if item[0] == item_id
          @multiusable_items[i][1]-=1
          # If have no more uses, delete it
          if @multiusable_items[i][1] == 0
           @multiusable_items.delete(item)
           @items[item_id] = [[item_number(item_id) -1, 0].max, 99].min
         end
         break
       end
       i+=1
       end
      elsif $scene.is_a?(Scene_Shop) and multiusable?(item_id)
        i=0
        to_lose = n
        @multiusable_items.sort! {|a,b|a[1]<=> b[1]}
        for item in @multiusable_items
          if to_lose == 0
            break
          end
          if item[0] == item_id
             @multiusable_items.delete_at(i)
             to_lose-=1
          end
          i+=1
        end
        @items[item_id] = [[item_number(item_id) -n, 0].max, 99].min
       else
       # Reverse the numerical value and call it gain_item
        gain_item(item_id, -n)
      end
    end
   
  #--------------------------------------------------------------------------
  # * Have Multiusables?
  #--------------------------------------------------------------------------
  def have_multiusables?(item_id)
       for item in @multiusable_items
         if item[0] == item_id
           return true
         end
       end
      return false
  end
   
  #--------------------------------------------------------------------------
  # * Multiusables?
  #--------------------------------------------------------------------------
  def multiusable?(item_id)
    return Wep::Multiusable_items[item_id]
  end
end
 
if Wep::Show_uses
  class Window_Item < Window_Selectable
    #--------------------------------------------------------------------------
    # * Help Text Update
    #--------------------------------------------------------------------------
    def update_help
      if Wep::Multiusable_items[self.item.id]
        for item in $game_party.multiusable_items
         if item[0] == self.item.id
           uses=item[1]
           break
         end
       end
        description = uses.to_s+'/'+Wep::Multiusable_items[self.item.id].to_s+Wep::Uses_text+self.item.description
        @help_window.set_text(description)
      else
        @help_window.set_text(self.item == nil ? "" : self.item.description)
      end
    end
  end
 
  class Window_ShopSell < Window_Selectable
    #--------------------------------------------------------------------------
    # * Help Text Update
    #--------------------------------------------------------------------------
    def update_help
      if Wep::Multiusable_items[self.item.id]
        for item in $game_party.multiusable_items
         if item[0] == self.item.id
           uses=item[1]
           break
         end
       end
        description = uses.to_s+'/'+Wep::Multiusable_items[self.item.id].to_s+Wep::Uses_text+self.item.description
        @help_window.set_text(description)
      else
        @help_window.set_text(self.item == nil ? "" : self.item.description)
      end
    end
  end 
end

   
28
RPG Maker Scripts / New picture text command
September 09, 2010, 08:55:05 pm
Remember making eternal event systems in old makers? Creating the numbers and words images? And the condition systems to show that numbers and words?

I remember, and hate xD. Maybe its just for the XP but... anyway this script will help in that things.


This script can show pictures based on a text line. The image will be treated lik ea normal picture loaded with the show picture event command. It have the same rules and can be moved, changue tone, erased, etc...

Then you need to put a command show picture with any image(its not used) and the values that you will put in a normal event command show picture. The script then creates creates a bitmap based on your text and options and loading a event picture with it.

The basic options are:
-Color
-Size
-Font type
-Bold
-Italic
-Default values
-Optimitzed large lines support.

Advanced options(Using MACL script, more info inside)
-Shadow
-Vertical gradient
-Horizontal gradient
-Outline

It includes advices to draw event variables.


A call script example:

@m = Message.new
@m.bold = true
@m.size = 48
@m.font = "Arial"
@m.italic = true
@m.color = Color.new(134,176,188,154)
@m.t"Text to show"
+Event command Show Picture

Note: This is my first completed script. Its in development, tell me any suggerences or bugs. My english is bad, if you see some thing to improve in the instructions...

Complete instructions in the script.
Code: text
#==============================================================================
# Picture Text Command
# By gerkrt/gerrtunk
# Version: 2
# License: GPL, credits
#==============================================================================

=begin

----------------------------------
Instalation and compatiility
----------------------------------
-Put this script before main.
-To use advance effects install MACL. Here: http://etheon.net/public/dl/macl_complete.txt
Here the forum thread: http://www.hbgames.org/forums/viewtopic.php?f=11&t=9417
-To install read the instructions. Anyway, you have to put before main but after
this script.

----------------------------------
Instructions
----------------------------------

This script can show pictures based on a text line. The image will be treated like
a normal picture loaded with the show picture event command. It have the same
rules and can be moved, changue tone, erased, etc...

A call script example:

@m = Message.new
@m.bold = true
@m.size = 48
@m.font = "Arial"
@m.italic = true
@m.color = Color.new(134,176,188,154)
@m.t"Text to show"

Then you need to put a command show picture with any image(its not used) and the
values that you will put in a normal event command show picture. The script then creates
creates a bitmap based on your text and options and loading a event picture with it.

You have to use this structure of call script+show picture to use this new command.

----------------------------------
Options and meanings
----------------------------------

Basic options. Description before #:

@m = Message.new    # Dont changue or remove this. Always the first thing.

@m.bold = true   # Bold letter
@m.size = 48   # Size of the font
@m.font = "Arial" # Fontname
@m.italic = true   # Cursive italic
@m.color = Color.new(134,176,188,154)   # Text basic color.
@m.t"Wep" # Text to write in the brackets "".

Advanced options. Only with MACL.

@m.shadow = true   # Shadowed font
@m.s_color = Color.new(134,176,188,154)   # Shadow color
@m.outline = true   # Shows a outline
@m.o_color = Color.new(134,176,188,154)   # Outline color
@m.horiz_grad = true   # Horizontal gradient with two colors
@m.vert_grad = true   # Vertical gradient with two colors
@m.g1_color = Color.new(134,176,188,154)   # Gradiet Starting color
@m.g2_color = Color.new(1,255,188,154)   #  Gradiet Endig color

-The only fixed option is @m = Message.new. If you only put this will chargue
a picture based only in your predefenided values.

-Then you have to compose your call scripts adding a option in a new line every time
This a example:

Show message "Noooooo", size 16 and horizontal gradient with defined colors:

@m = Message.new   
@m.t"Nooooooooooooooooo"
@m.size = 16
@m.horiz_grad = true
@m.g1_color = Color.new(134,176,188,154)
@m.g2_color = Color.new(1,255,188,154)

-The order dont care. The only rule is to put the @m = Message.new first.

-The two gradients use the same colors values.

-Incompatible effects: the two gradients, shadow/outline.

-Remember to quit the #'s.

-You can make a large call script in two call scripts, simply continue writting
in the next. The other option is:

@m.size = 16 ; @m.horiz_grad = true

The ; is a ruby line internal separator. Its like they are in different lines.

-Some advice about the values:

Color.new(134,176,188,154) Red,Green,Blue+alpha Only changue the numbers. 0-255.
"Texts": You must use the "" and the text inside of them.
true/false: It means Active or Inactive. For example to write bold: @m.bold = true

If the sucker call script gives you strange errors this is what you can try:

    -Recolocate the larger scripts lines: spaces,intros,etc
    -Add a new option at the end, event if its inactive one.
   
--------------------------------------------
Advices to write the text
--------------------------------------------

-To only write a event variable value :
  @m.t$game_variables[variable_id].to_s

-Complex phrases:
  @m.t"HP:"+$game_variables[variable_id].to_s+" "+"Z"

It writes  HP:var Z.

-In ruby the + concatenate words to make larger ones.
-Use " " if you need some spaces or aligns
-Respect the "" word delimitators.
-The $game_variables[variable_id].to_s dont use "", but internslly its treated like a word
-variable_id: The number ID of a event variable

----------------------------------
Long lines
----------------------------------

Call script command suck for these. This a example of what you have to do:

@m.t"HP:"+$game_variables[variable_id].to_s

@m.t" MP:"+$game_variables[variable_id2].to_s

@m.t" Limit: "+$game_variables[variable_id3].to_s

The script automatically concatenates all. Just write it in order.

------------------------
Default values
------------------------

If you need this, you can make your predefenided values for all the options.
With this, the command can be shorter, removing the lines you dont need.

The constants names are Def_font_+ the option of the @ that you alreadyknow.

=end
module Wep
  Def_font_name = "Arial"
  Def_font_text = "Wep"
  Def_font_size = 24
  Def_font_bold = false
  Def_font_italic = false
  Def_font_color = Color.new(255, 255, 255, 255)   # The normal color
  Def_font_horiz_grad = false
  Def_font_vert_grad = false
  Def_font_outline = false
  Def_font_shadow = false
  Def_font_s_color = Color.new(0, 0, 0, 100)
  Def_font_o_color = Color.new(0, 0, 0)
  Def_font_g1_color = Color.new(255, 45, 255)
  Def_font_g2_color = Color.new(12, 128, 128)
end


#==============================================================================
class Message
  attr_accessor   :text
  attr_accessor   :font
  attr_accessor   :size
  attr_accessor   :bold
  attr_accessor   :italic
  attr_accessor   :color
  attr_accessor   :horiz_grad
  attr_accessor   :vert_grad
  attr_accessor   :shadow
  attr_accessor   :outline
  attr_accessor   :s_color
  attr_accessor   :o_color
  attr_accessor   :g1_color
  attr_accessor   :g2_color
  def initialize(text=Wep::Def_font_text,font=Wep::Def_font_name,size=Wep::Def_font_size,bold=Wep::Def_font_bold,italic=Wep::Def_font_italic, color=Wep::Def_font_color, horiz_grad=Wep::Def_font_horiz_grad,vert_grad=Wep::Def_font_vert_grad,outline=Wep::Def_font_outline,shadow=Wep::Def_font_shadow, s_color=Wep::Def_font_s_color, o_color=Wep::Def_font_o_color,g1_color=Wep::Def_font_g1_color,g2_color=Wep::Def_font_g2_color)    @text = text
    @font = font
    @size = size
    @bold = bold
    @italic = italic
    @color = color
    @s_color = s_color
    @o_color = o_color
    @g1_color = g1_color
    @g2_color = g2_color   
    @horiz_grad = horiz_grad
    @vert_grad = vert_grad
    @shadow = shadow
    @text = ""
    @text = text
    @outline = outline
    @first_concat = true
  end
 
  #--------------------------------------------------------------------------
  # *t This metod concatenates the text string.
  # Optimitzed to be very short.
  #--------------------------------------------------------------------------

  def t(text)
    # Check if the text is the predefined and its the first time to add
    # and clears it
    if Wep::Def_font_text == @text and @first_concat
      @text = ""
    end
    @first_concat = false
    @text += text
  end
end

class Sprite_Picture
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    # If picture file name is different from current one and have a message
    if @picture_name != @picture.name and @picture.message
       # Remember file name to instance variables
      @picture_name = @picture.name
       #if @picture_name != ""
        # Get picture graphic

       #end
        # Use the testing bitmap to know text size
        $game_screen.testing_bitmap.font.name = @picture.message.font
        $game_screen.testing_bitmap.font.size = @picture.message.size
        $game_screen.testing_bitmap.font.bold = @picture.message.bold
        $game_screen.testing_bitmap.font.italic = @picture.message.italic
        line = @picture.message.text
        needed_rect = $game_screen.testing_bitmap.text_size(line)
        # Changue basic font options
        self.bitmap = Bitmap.new(needed_rect.width, needed_rect.height)
        self.bitmap.font.name = @picture.message.font
        self.bitmap.font.size = @picture.message.size
        self.bitmap.font.bold = @picture.message.bold
        self.bitmap.font.italic = @picture.message.italic
        self.bitmap.font.color = @picture.message.color
        # Exception check if MACL is instaled or not
        begin
          if MACL != nil
             # Changue advanced font options
             self.bitmap.font.horiz_grad = @picture.message.horiz_grad
             self.bitmap.font.vert_grad = @picture.message.vert_grad
             self.bitmap.font.outline = @picture.message.outline
             self.bitmap.font.shadow = @picture.message.shadow
             self.bitmap.font.shadow_color = @picture.message.s_color
             self.bitmap.font.outline_color = @picture.message.o_color
             self.bitmap.font.grad_s_color = @picture.message.g1_color
             self.bitmap.font.grad_e_color = @picture.message.g2_color
          end
        rescue
        end
       self.bitmap.draw_text(0, 0, needed_rect.width, needed_rect.height, line)

    end
    # If picture file name is different from current one
    if @picture_name != @picture.name and @picture.message == nil
      # Remember file name to instance variables
      @picture_name = @picture.name
      # If file name is not empty
      if @picture_name != ""
        # Get picture graphic
        self.bitmap = RPG::Cache.picture(@picture_name)
      end
    end
    # If file name is empty
    if @picture_name == ""
      # Set sprite to invisible
      self.visible = false
      return
    end
    # Set sprite to visible
    self.visible = true
    # Set transfer starting point
    if @picture.origin == 0
      self.ox = 0
      self.oy = 0
    else
      self.ox = self.bitmap.width / 2
      self.oy = self.bitmap.height / 2
    end
    # Set sprite coordinates
    self.x = @picture.x
    self.y = @picture.y
    self.z = @picture.number
    # Set zoom rate, opacity level, and blend method
    self.zoom_x = @picture.zoom_x / 100.0
    self.zoom_y = @picture.zoom_y / 100.0
    self.opacity = @picture.opacity
    self.blend_type = @picture.blend_type
    # Set rotation angle and color tone
    self.angle = @picture.angle
    self.tone = @picture.tone
  end
end

class Game_Screen
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor  :testing_bitmap         # Unique testing bitmap for text size calculation
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  alias gsc_init initialize
  def initialize
     gsc_init
     @testing_bitmap = Bitmap.new(1,1)
  end
end




class Game_Picture
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :message                    # text
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     number : picture number
  #--------------------------------------------------------------------------
  alias gp_init initialize
  def initialize(number)
    gp_init(number)
    @message = nil
  end
 
  alias gp_show show
  def show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type, message=nil)
    gp_show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
    @message = message
  end
  alias gp_erase erase
  def erase
    gp_erase
    @message = nil
  end
end


class Interpreter
  #--------------------------------------------------------------------------
  # * Show Picture
  #--------------------------------------------------------------------------
  def command_231
      # Get picture number
    number = @parameters[0] + ($game_temp.in_battle ? 50 : 0)
    # If appointment method is [direct appointment]
    if @parameters[3] == 0
      x = @parameters[4]
      y = @parameters[5]
    # If appointment method is [appoint with variables]
    else
      x = $game_variables[@parameters[4]]
      y = $game_variables[@parameters[5]]
    end
    # Show picture
   # If message is written
   if @m != nil
    $game_screen.pictures[number].show(@parameters[1], @parameters[2],
    x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9], @m)
    # Format m for other calls
    @m = nil
   else
    $game_screen.pictures[number].show(@parameters[1], @parameters[2],
    x, y, @parameters[6], @parameters[7], @parameters[8], @parameters[9])

   end
    # Continue
    return true
  end
end
29
RPG Maker Scripts / [XP]Betatester diary
September 09, 2010, 08:54:00 pm
This script allows you to keep a diary of the player's actions in the game
with the purpose of being able to analyze the betatester playthrough.

For this purpose the script gives you three tools:

1-Game-Journal: The information is saved the current game, as
the configuration and type you choose. This journal keep a new entry every once you call it with a call script.

2 Save-Journal: This saves the save number, playing time and
additional information. It is updated every time you save automatically.

3-Write other data: Here you could enter values of variables or switches of within the game, for example, an indicator of % completed game.

-Three methods to add info: Simple, complex(you can configure it) and total. Also, you can choose if you want to write all  actors info or only the group.
-High costumitzation and flexibility
-Title identifiers
-End and start headers.
-A compact text style mode.
-High compatibility
-Some features to improve you work with these  files
Under development. Suggerences,bugs, traductions mistakes...etc i will listen.

This a example of the game-log. My database is spanish.
Code: text
------------------------------------------
||||GAME START||||
------------------------------------------
Title: Alderhast
Autor: Wep
Version: 0.5z
Date: Mon Jan 01 09:35:46 Hora estándar romance 2007
Autor introduction: Welcome!

------------------------------------------
||||LOST FOREST||||
------------------------------------------

Date: Mon Jan 01 09:35:46 Hora estándar romance 2007
Playtime: 00:00:00
Money: 675. Steps: 0. Map: 1 (MAP001)


------------------------
Alexis (Luchador) Nv1
------------------------


Equipment:

 Armas: Espada Bronce
 Escudo: Escudo Bronce
 Cabeza: Yelmo Bronce
 Cuerpo: Armadura Bronce
 Armas: Anillo Destreza


Parameters:

 HP 741\741. SP 534\534
 Str 67. Dex 69. Agi 58
 Int 36. PDef 153. MDef 138
 Atk 112. Eva 0

Skills:

 Cruz Sagrada. Ataque Finta
 Huracán.

------------------------
Basil (Lancero) Nv1
------------------------


Equipment:

 Armas: Lanza Bronce
 Escudo: Escudo Bronce
 Cabeza:
 Cuerpo: Peto Bronce
 Accesorio:


Parameters:

 HP 695\695. SP 591\591
 Str 60. Dex 65. Agi 62
 Int 31. PDef 96. MDef 89
 Atk 110. Eva 0

Skills:

 Barrido Regu.

------------------------
Silas (Mercenario) Nv1
------------------------


Equipment:

 Armas: Hacha Bronce
 Escudo: Escudo Bronce
 Cabeza: Yelmo Bronce
 Cuerpo: Armadura Bronce
 Accesorio:


Parameters:

 HP 747\747. SP 435\435
 Str 76. Dex 56. Agi 52
 Int 37. PDef 153. MDef 138
 Atk 114. Eva 0

Skills:

 Rompe Brazo.

------------------------
Dorothy (Ladrón) Nv1
------------------------


Equipment:

 Armas: Daga Bronce
 Escudo:
 Cabeza: Yelmo Bronce
 Cuerpo:
 Accesorio:


Parameters:

 HP 546\546. SP 590\590
 Str 41. Dex 73. Agi 72
 Int 32. PDef 53. MDef 47
 Atk 108. Eva 0

Skills:

 Golpe Serpiente.

------------------------
Ester (Arquero) Nv1
------------------------


Equipment:

 Armas: Arco Bronce
 Escudo:
 Cabeza: Yelmo Bronce
 Cuerpo: Peto Bronce
 Accesorio:


Parameters:

 HP 590\590. SP 570\570
 Str 50. Dex 79. Agi 62
 Int 48. PDef 127. MDef 116
 Atk 111. Eva 0

Skills:

 Asesino Aves.

------------------------
Félix (Pistolero) Nv1
------------------------


Equipment:

 Armas: Revólver
 Escudo:
 Cabeza: Yelmo Bronce
 Cuerpo: Peto Bronce
 Accesorio:


Parameters:

 HP 656\656. SP 531\531
 Str 51. Dex 62. Agi 50
 Int 33. PDef 127. MDef 116
 Atk 115. Eva 0

Skills:

 Plata Barrett.

------------------------
Gloria (Acólito) Nv1
------------------------


Equipment:

 Armas: Mazo Bronce
 Escudo:
 Cabeza: Sombrero Algodón
 Cuerpo: Túnica Algodón
 Accesorio:


Parameters:

 HP 486\486. SP 661\661
 Str 43. Dex 55. Agi 55
 Int 64. PDef 116. MDef 124
 Atk 109. Eva 0

Skills:

 Cura.

------------------------
Hilda (Mago) Nv1
------------------------


Equipment:

 Armas: Bastón Bronce
 Escudo:
 Cabeza: Sombrero Algodón
 Cuerpo: Túnica Algodón
 Accesorio:


Parameters:

 HP 422\422. SP 606\606
 Str 31. Dex 30. Agi 46
 Int 71. PDef 116. MDef 124
 Atk 107. Eva 0

Skills:

 Fuego.

--------------
Inventary:
--------------
 
Items:

 Poción: 15. Super Poción: 1
 Antídoto: 1
 
Weapons:

 Espada Bronce: 1.

Armors:

 Escudo Bronce: 1. Escud Caos: 1
 

------------------------------------------
||||MY EXTRA DATA||||
------------------------------------------
% completed game: 6

Lime king killed: true
I survived the hard dungeon: false

------------------------------------------
||||GAME END||||
------------------------------------------
Title: Alderhast
Autor: Wep
Version: 0.5z
Date: Mon Jan 01 09:35:46 Hora estándar romance 2007
End note: Good night


Save-Log:

Code: text
------------------------------------------
||||Save 1||||
------------------------------------------

Playtime: 00:00:03. Money: 675. Map: 1 (MAP001)

Alexis (Luchador) Nv1

Basil (Lancero) Nv1

Gloria (Acólito) Nv1

Hilda (Mago) Nv1

------------------------------------------
||||Save 2||||
------------------------------------------

Playtime: 00:00:05. Money: 675. Map: 1 (MAP001)

Alexis (Luchador) Nv1

Basil (Lancero) Nv1

Gloria (Acólito) Nv1

Hilda (Mago) Nv1

------------------------------------------
||||Save 3||||
------------------------------------------

Playtime: 00:00:05. Money: 675. Map: 1 (MAP001)

Alexis (Luchador) Nv1

Basil (Lancero) Nv1

Gloria (Acólito) Nv1

Hilda (Mago) Nv1



Script code in other post: