def write_mail(topic = nil,from = nil,msg = [], type = nil, font = nil) if SC::MAIL_HEAR_SOUND == true # Sound when receiving Audio.se_play("Audio/SE/055-Right01", 100, 150) # You may change the soundfile # In fact, you may even use Music Effects, BGM (not recommended) or BGS. # Change the 'se_play' to 'me_play','bgm_play' or 'bgs_play' respectivly. # You should also change the directory when something else than SE is used. end if topic == nil or topic == ""# Subject of message @mail.push("(no subject)") # if no subject specified else @mail.push(topic) end if msg == nil # Write a message in array format, like: ["line1, "line2, "etc"] @msg.push(["* AUTO MAIL*","No message specified by the sender."," ","Greetings from webmaster@mailserver.rxsc"]) else @msg.push(msg) end if from == nil or from == "" # The sender of the mail @sender.push("(unknown)") # if no sender specified else @sender.push(from) end if font != nil @font.push(font) else @font.push(nil) end @read.push(false) # set it to unread if type != nil # some cool stuff if type == 1 # Type 1: Corrupted Mail @msg[topic].push("","* AUTO MAIL *","The mail is corrupted.","Sorry for this inconvinience.","","Greetings from Webmaster") elsif type == 2 # Type 2: Infected Mail @msg[topic].push("","* AUTO MAIL *","This mail is infected.","Delete it immediately.","","Greetings from Webmaster") elsif type == 3 # Type 3: Incomplete Mail @msg[topic].push("","* AUTO MAIL *","Mail was not sent correctly.","Some parts may have been lost.","","Greetings from Webmaster") elsif type == 4 # Add more if you like, see above for the examples end end endend

# This is the topic window or in other words the message window.# So this is the window where the contents of a mail is shown.# You may change it in how you want it actually.# Screwing this up is your own fault... but then again, you can always repaste...class Window_Topic < Window_Base attr_reader :msg def initialize(mail) super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.visible = false @mail = mail # This is the index of the inbox and will be converted to the mail ID refresh end

# This is a example mail for you to learn from.# Study this and you'll learn it in no time!class Scene_Title alias mail_title_new_game command_new_game def command_new_game mail_title_new_game $mail = Mail.new endend