Fixed quest rewarding + Lethal attacks in Dojo
Fixed quests not giving items in some cases, lethal damages rendering dojo uncompletable and added new scripts.
This commit is contained in:
76
scripts/event/0_EXAMPLE.js
Normal file
76
scripts/event/0_EXAMPLE.js
Normal file
@@ -0,0 +1,76 @@
|
||||
function init() {
|
||||
// After loading, ChannelServer
|
||||
}
|
||||
|
||||
function setup(eim, leaderid) {
|
||||
// Setup the instance when invoked, EG : start PQ
|
||||
}
|
||||
|
||||
function playerEntry(eim, player) {
|
||||
// Warp player in etc..
|
||||
}
|
||||
|
||||
function changedMap(eim, player, mapid) {
|
||||
// What to do when player've changed map, based on the mapid
|
||||
}
|
||||
|
||||
function scheduledTimeout(eim) {
|
||||
// When event timeout..
|
||||
|
||||
// restartEventTimer(long time)
|
||||
// stopEventTimer()
|
||||
// startEventTimer(long time)
|
||||
// isTimerStarted()
|
||||
}
|
||||
|
||||
function allMonstersDead(eim) {
|
||||
// When invoking unregisterMonster(MapleMonster mob) OR killed
|
||||
// Happens only when size = 0
|
||||
}
|
||||
|
||||
function playerDead(eim, player) {
|
||||
// Happens when player dies
|
||||
}
|
||||
|
||||
function playerRevive(eim, player) {
|
||||
// Happens when player's revived.
|
||||
// @Param : returns true/false
|
||||
}
|
||||
|
||||
function playerDisconnected(eim, player) {
|
||||
// return 0 - Deregister player normally + Dispose instance if there are zero player left
|
||||
// return x that is > 0 - Deregister player normally + Dispose instance if there x player or below
|
||||
// return x that is < 0 - Deregister player normally + Dispose instance if there x player or below, if it's leader = boot all
|
||||
}
|
||||
|
||||
function monsterValue(eim, mobid) {
|
||||
// Invoked when a monster that's registered has been killed
|
||||
// return x amount for this player - "Saved Points"
|
||||
}
|
||||
|
||||
function leftParty(eim, player) {
|
||||
// Happens when a player left the party
|
||||
}
|
||||
|
||||
function disbandParty(eim, player) {
|
||||
// Happens when the party is disbanded by the leader.
|
||||
}
|
||||
|
||||
function clearPQ(eim) {
|
||||
// Happens when the function EventInstanceManager.finishPQ() is invoked by NPC/Reactor script
|
||||
}
|
||||
|
||||
function removePlayer(eim, player) {
|
||||
// Happens when the funtion NPCConversationalManager.removePlayerFromInstance() is invoked
|
||||
}
|
||||
|
||||
function registerCarnivalParty(eim, carnivalparty) {
|
||||
// Happens when carnival PQ is started. - Unused for now.
|
||||
}
|
||||
|
||||
function onMapLoad(eim, player) {
|
||||
// Happens when player change map - Unused for now.
|
||||
}
|
||||
|
||||
function cancelSchedule() {
|
||||
}
|
||||
84
scripts/event/s4aWorld.js
Normal file
84
scripts/event/s4aWorld.js
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* 4th Job Snipe / Concentration
|
||||
*/
|
||||
|
||||
function init() {
|
||||
em.setProperty("started", "false");
|
||||
}
|
||||
|
||||
function monsterValue(eim, mobId) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
function setup() {
|
||||
var eim = em.newInstance("s4aWorld");
|
||||
|
||||
eim.setInstanceMap(910500000).resetFully();
|
||||
eim.startEventTimer(1200000);
|
||||
|
||||
em.setProperty("started", "true");
|
||||
|
||||
return eim;
|
||||
}
|
||||
|
||||
function playerEntry(eim, player) {
|
||||
var map = eim.getMapFactory().getMap(910500000);
|
||||
player.changeMap(map, map.getPortal(0));
|
||||
}
|
||||
|
||||
function playerDead(eim, player) {
|
||||
}
|
||||
|
||||
function playerRevive(eim, player) {
|
||||
}
|
||||
|
||||
function scheduledTimeout(eim) {
|
||||
eim.disposeIfPlayerBelow(100, 105090200);
|
||||
|
||||
em.setProperty("started", "false");
|
||||
}
|
||||
|
||||
function changedMap(eim, player, mapid) {
|
||||
if (mapid != 910500000) {
|
||||
eim.unregisterPlayer(player);
|
||||
|
||||
if (eim.disposeIfPlayerBelow(0, 0)) {
|
||||
em.setProperty("started", "false");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function playerDisconnected(eim, player) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function leftParty(eim, player) {
|
||||
// If only 2 players are left, uncompletable:
|
||||
playerExit(eim, player);
|
||||
}
|
||||
|
||||
function disbandParty(eim) {
|
||||
//boot whole party and end
|
||||
eim.disposeIfPlayerBelow(100, 105090200);
|
||||
|
||||
em.setProperty("started", "false");
|
||||
}
|
||||
|
||||
function playerExit(eim, player) {
|
||||
eim.unregisterPlayer(player);
|
||||
var map = eim.getMapFactory().getMap(105090200);
|
||||
player.changeMap(map, map.getPortal(0));
|
||||
}
|
||||
|
||||
function clearPQ(eim) {
|
||||
eim.disposeIfPlayerBelow(100, 105090200);
|
||||
|
||||
em.setProperty("started", "false");
|
||||
}
|
||||
|
||||
function allMonstersDead(eim) {
|
||||
//has nothing to do with monster killing
|
||||
}
|
||||
|
||||
function cancelSchedule() {
|
||||
}
|
||||
62
scripts/npc/world0/1061012.js
Normal file
62
scripts/npc/world0/1061012.js
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
NPC Name: Insiginificant Being
|
||||
Map(s): Dungeon : Another Entrance
|
||||
Description: Takes you to another Dimension
|
||||
*/
|
||||
|
||||
function start() {
|
||||
if (cm.getQuestStatus(6108) == 1) {
|
||||
var ret = checkJob();
|
||||
if (ret == -1) {
|
||||
cm.sendOk("Please form a party and talk to me again.");
|
||||
} else if (ret == 0) {
|
||||
cm.sendOk("Please make sure that your party is a size of 2.");
|
||||
} else if (ret == 1) {
|
||||
cm.sendOk("One of your party member's job is not eligible for entering the other world.");
|
||||
} else if (ret == 2) {
|
||||
cm.sendOk("One of your party member's level is not eligible for entering the other world.");
|
||||
} else {
|
||||
var em = cm.getEventManager("s4aWorld");
|
||||
if (em == null) {
|
||||
cm.sendOk("You're not allowed to enter with unknown reason. Try again." );
|
||||
} else if (em.getProperty("started").equals("true")) {
|
||||
cm.sendOk("Someone else is already attempting to defeat the Jr.Balrog in another world." );
|
||||
} else {
|
||||
em.startInstance(cm.getParty(), cm.getMap());
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
cm.sendOk("You're not allowed to enter the other world with unknown reason.");
|
||||
}
|
||||
|
||||
cm.dispose();
|
||||
}
|
||||
|
||||
function action(mode, type, selection) {
|
||||
}
|
||||
|
||||
function checkJob() {
|
||||
var party = cm.getParty();
|
||||
|
||||
if (party == null) {
|
||||
return -1;
|
||||
}
|
||||
// if (party.getMembers().size() != 2) {
|
||||
// return 0;
|
||||
// }
|
||||
var it = party.getMembers().iterator();
|
||||
|
||||
while (it.hasNext()) {
|
||||
var cPlayer = it.next();
|
||||
|
||||
if (cPlayer.getJobId() == 312 || cPlayer.getJobId() == 322 || cPlayer.getJobId() == 900) {
|
||||
if (cPlayer.getLevel() < 120) {
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
Reference in New Issue
Block a user