冰楓論壇

 找回密碼
 立即註冊
ads_sugarbook
搜索
查看: 653|回覆: 0

[修改] CMS服务端修改教程-家族公会对抗战

[複製鏈接]

31

主題

0

好友

31

積分

新手上路

Rank: 1

UID
286271
帖子
42
主題
31
精華
0
積分
31
楓幣
499
威望
31
存款
0
贊助金額
0
推廣
0
GP
31
閱讀權限
10
性別
保密
在線時間
2 小時
註冊時間
2020-7-12
最後登入
2021-4-13
發表於 2020-7-12 16:06:12 |顯示全部樓層
/*
* This file is part of the OdinMS Maple Story Server
    Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
                       Matthias Butz <matze@odinms.de>
                       Jan Christian Meyer <vimes@odinms.de>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License version 3
    as published by the Free Software Foundation. You may not use, modify
    or distribute this program under any other version of the
    GNU Affero General Public License.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

/*
* @Author Lerk
*
* Shuang, Victoria Road: Excavation Site<Camp> (101030104)
*
* Start of Guild Quest
*/

var status;
var GQItems = new Array(1032033, 4001024, 4001025, 4001026, 4001027, 4001028, 4001031, 4001032, 4001033, 4001034, 4001035, 4001037);

function start() {
        status = -1;
        action(1, 0, 0);
}

function action(mode, type, selection) {
        if (mode == -1) {
                cm.dispose();
        } else {
                if (mode == 0 && status == 0) {
                        cm.dispose();
                        return;
                }
                if (mode == 1)
                        status++;
                else
                        status--;
                if (status == 0) {
                        cm.sendSimple("这里是通往圣瑞尼亚遗址的出发地点. 你现在想做什么? #b\r\n#L0#我是族长,我想开始家族公会对抗战#l\r\n#L1#我是族员,我想加入家族公会对抗战#l");                                               
                }
                else if (status == 1) {
                        if (selection == 0) { //Start
                                if (cm.getPlayer().getGuildId() == 0 || cm.getPlayer().getGuildRank() >= 3) { //no guild or not guild master/jr. master
                                        cm.sendNext("只有家族的族长或者副族长才有资格开始圣瑞尼亚遗址公会对抗战.");
                                        cm.dispose();
                                }
                                else {
                                        //no true requirements, make an instance and start it up
                                        //cm.startPQ("ZakumPQ");
                                        var em = cm.getEventManager("GuildQuest");
                                        if (em == null) {
                                                cm.sendOk("很抱歉,本轮家族公会对抗赛正在进行中,请您稍后再来.");
                                        } else {
                                                if (getEimForGuild(em, cm.getPlayer().getGuildId()) != null) {
                                                        cm.sendOk("你所在的家族已经开始进行公会对抗赛. 请您稍后再来.")
                                                }
                                                else {
                                                        //start GQ
                                                        var guildId = cm.getPlayer().getGuildId();
                                                        var eim = em.newInstance(guildId);
                                                        em.startInstance(eim, cm.getPlayer().getName());

                                                        //force the two scripts on portals in the map
                                                        var map = eim.getMapInstance(990000000);

                                                        map.getPortal(5).setScriptName("guildwaitingenter");
                                                        map.getPortal(4).setScriptName("guildwaitingexit");

                                                        eim.registerPlayer(cm.getPlayer());
                                                        cm.guildMessage("The guild has been entered into the Guild Quest. Please report to Shuang at the Excavation Camp on channel " + cm.getC().getChannel() + ".");

                                                        //remove all GQ items from player entering
                                                        for (var i = 0; i < GQItems.length; i++) {
                                                                cm.removeAll(GQItems);
                                                        }
                                                }
                                        }
                                        cm.dispose();
                                }
                        }
                        else if (selection == 1) { //entering existing GQ
                                if (cm.getPlayer().getGuildId() == 0) { //no guild or not guild master/jr. master
                                        cm.sendNext("You must be in a guild to join an instance.");
                                        cm.dispose();
                                }
                                else {
                                        var em = cm.getEventManager("GuildQuest");
                                        if (em == null) {
                                                cm.sendOk("家族公会对抗赛正在进行中,请您稍后再来.");
                                        } else {
                                                var eim = getEimForGuild(em, cm.getPlayer().getGuildId());
                                                if (eim == null) {
                                                        cm.sendOk("你的家族现在还没有进行登记,不能参加家族公会对抗赛.");
                                                }
                                                else {
                                                        if ("true".equals(eim.getProperty("canEnter"))) {
                                                                eim.registerPlayer(cm.getPlayer());

                                                                //remove all GQ items from player entering
                                                                for (var i = 0; i < GQItems.length; i++) {
                                                                        cm.removeAll(GQItems);
                                                                }
                                                        }
                                                        else {
                                                                cm.sendOk("很抱歉,族长已经将你制裁,本论家族公会对抗赛你将不能参加. 请您稍后再试.");
                                                        }
                                                }
                                        }
                                        cm.dispose();
                                }
                        }
                }
        }
}

function getEimForGuild(em, id) {
        var stringId = "" + id;
        return em.getInstance(stringId);
}

複製連結並發給好友,以賺取推廣點數
簡單兩步驟,註冊、分享網址,即可獲得獎勵! 一起推廣文章換商品、賺$$
高級模式
B Color Image Link Quote Code Smilies

廣告刊登意見回饋關於我們職位招聘本站規範DMCA隱私權政策

Copyright © 2011-2024 冰楓論壇, All rights reserved

免責聲明:本網站是以即時上載留言的方式運作,本站對所有留言的真實性、完整性及立場等,不負任何法律責任。

而一切留言之言論只代表留言者個人意見,並非本網站之立場,用戶不應信賴內容,並應自行判斷內容之真實性。

小黑屋|手機版|冰楓論壇

GMT+8, 2024-4-18 18:31

回頂部