This repository has been archived by the owner on Oct 9, 2020. It is now read-only.
forked from Hudell/mv-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OrangeMapChangeEvent.js
59 lines (51 loc) · 1.89 KB
/
OrangeMapChangeEvent.js
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
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
57
58
59
/*=============================================================================
* Orange - Map Change Event
* By Hudell - www.hudell.com
* OrangeMapChangeEvent.js
* Version: 1.0
* Free for commercial and non commercial use.
*=============================================================================*/
/*:
* @plugindesc Will let you call a common event everytime the player is transfered to a new map
*
* @author Hudell
*
* @param commonEventId
* @desc The number of the common event to call
* @default 0
*
* @help
* ============================================================================
* Latest Version
* ============================================================================
*
* Get the latest version of this script on
* http://link.hudell.com/map-change-event
*
*=============================================================================*/
var Imported = Imported || {};
var OrangeMapChangeEvent = OrangeMapChangeEvent || {};
(function($) {
"use strict";
$.Parameters = PluginManager.parameters('OrangeMapChangeEvent');
$.Param = $.Param || {};
$.Param.commonEventId = Number($.Parameters['commonEventId'] || 0);
var oldGamePlayer_performTransfer = Game_Player.prototype.performTransfer;
Game_Player.prototype.performTransfer = function() {
if (this.isTransferring()) {
if ($.Param.commonEventId !== undefined && $.Param.commonEventId > 0) {
$gameTemp.reserveCommonEvent($.Param.commonEventId);
}
}
oldGamePlayer_performTransfer.call(this);
};
})(OrangeMapChangeEvent);
if (Imported['MVCommons'] !== undefined) {
PluginManager.register("OrangeMapChangeEvent", "1.0.0", "Will let you call a common event everytime the player is transfered to a new map", {
email: "[email protected]",
name: "Hudell",
website: "http://www.hudell.com"
}, "2015-10-19");
} else {
Imported["OrangeMapChangeEvent"] = true;
}