Search in sources :

Example 1 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class MapleQuest method forceStart.

public boolean forceStart(MapleCharacter c, int npc) {
    MapleQuestStatus newStatus = new MapleQuestStatus(this, MapleQuestStatus.Status.STARTED, npc);
    newStatus.setForfeited(c.getQuest(this).getForfeited());
    if (timeLimit > 0) {
        newStatus.setExpirationTime(System.currentTimeMillis() + (timeLimit * 1000));
        c.questTimeLimit(this, timeLimit);
    }
    if (timeLimit2 > 0) {
        newStatus.setExpirationTime(System.currentTimeMillis() + timeLimit2);
        c.questTimeLimit2(this, newStatus.getExpirationTime());
    }
    c.updateQuest(newStatus);
    return true;
}
Also used : MapleQuestStatus(client.MapleQuestStatus)

Example 2 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class MapleQuest method forceComplete.

public boolean forceComplete(MapleCharacter c, int npc) {
    MapleQuestStatus newStatus = new MapleQuestStatus(this, MapleQuestStatus.Status.COMPLETED, npc);
    newStatus.setForfeited(c.getQuest(this).getForfeited());
    newStatus.setCompletionTime(System.currentTimeMillis());
    c.updateQuest(newStatus);
    // Quest completion
    c.getClient().getSession().write(MaplePacketCreator.showSpecialEffect(9));
    // use 9 instead of 12 for both
    c.getMap().broadcastMessage(c, MaplePacketCreator.showForeignEffect(c.getId(), 9), false);
    return true;
}
Also used : MapleQuestStatus(client.MapleQuestStatus)

Example 3 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class MapScriptMethods method touchTheSky.

public void touchTheSky() {
    // 29004
    MapleQuest quest = MapleQuest.getInstance(29004);
    if (!isQuestStarted(29004)) {
        if (!quest.forceStart(getPlayer(), 9000066)) {
            return;
        }
    }
    MapleQuestStatus q = getPlayer().getQuest(quest);
    if (!q.addMedalMap(getPlayer().getMapId())) {
        return;
    }
    String status = Integer.toString(q.getMedalProgress());
    getPlayer().announce(MaplePacketCreator.updateQuest(q, true));
    getPlayer().announce(MaplePacketCreator.earnTitleMessage(status + "/5 Completed"));
    getPlayer().announce(MaplePacketCreator.earnTitleMessage("The One Who's Touched the Sky title in progress."));
    if (Integer.toString(q.getMedalProgress()).equals(quest.getInfoEx())) {
        showInfoText("The One Who's Touched the Sky" + rewardstring);
        getPlayer().announce(MaplePacketCreator.getShowQuestCompletion(quest.getId()));
    } else {
        showInfoText("The One Who's Touched the Sky title in progress. " + status + "/5 Completed");
    }
}
Also used : MapleQuest(server.quest.MapleQuest) MapleQuestStatus(client.MapleQuestStatus)

Example 4 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class NextQuestAction method run.

@Override
public void run(MapleCharacter chr, Integer extSelection) {
    MapleQuestStatus status = chr.getQuest(MapleQuest.getInstance(questID));
    chr.announce(MaplePacketCreator.updateQuestFinish((short) questID, status.getNpc(), (short) nextQuest));
}
Also used : MapleQuestStatus(client.MapleQuestStatus)

Example 5 with MapleQuestStatus

use of client.MapleQuestStatus in project HeavenMS by ronancpl.

the class QuestAction method run.

@Override
public void run(MapleCharacter chr, Integer extSelection) {
    for (Integer questID : quests.keySet()) {
        int stat = quests.get(questID);
        chr.updateQuest(new MapleQuestStatus(MapleQuest.getInstance(questID), MapleQuestStatus.Status.getById(stat)));
    }
}
Also used : MapleQuestStatus(client.MapleQuestStatus)

Aggregations

MapleQuestStatus (client.MapleQuestStatus)16 MapleQuest (server.quest.MapleQuest)2 Item (client.inventory.Item)1 MaplePet (client.inventory.MaplePet)1 Point (java.awt.Point)1 ArrayList (java.util.ArrayList)1 MapleAlliance (net.server.guild.MapleAlliance)1 MapleGuild (net.server.guild.MapleGuild)1 CashItem (server.CashShop.CashItem)1 SpecialCashItem (server.CashShop.SpecialCashItem)1 MapleShopItem (server.MapleShopItem)1 MapleMapItem (server.maps.MapleMapItem)1 MaplePlayerShopItem (server.maps.MaplePlayerShopItem)1 MaplePacketLittleEndianWriter (tools.data.output.MaplePacketLittleEndianWriter)1