• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MapleMonsterInformationProvider类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中server.life.MapleMonsterInformationProvider的典型用法代码示例。如果您正苦于以下问题:Java MapleMonsterInformationProvider类的具体用法?Java MapleMonsterInformationProvider怎么用?Java MapleMonsterInformationProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MapleMonsterInformationProvider类属于server.life包,在下文中一共展示了MapleMonsterInformationProvider类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkMapDrop

点赞 2

import server.life.MapleMonsterInformationProvider; //导入依赖的package包/类
public String checkMapDrop() {
    List ranks = new ArrayList(MapleMonsterInformationProvider.getInstance().getGlobalDrop());
    int mapid = this.c.getPlayer().getMap().getId();
    int cashServerRate = getClient().getChannelServer().getCashRate();
    int globalServerRate = getClient().getChannelServer().getGlobalRate();
    if (ranks.size() > 0) {
        int num = 0;

        StringBuilder name = new StringBuilder();
        for (Object rank : ranks) {
            MonsterGlobalDropEntry de = (MonsterGlobalDropEntry) rank;
            if ((de.continent < 0) || ((de.continent < 10) && (mapid / 100000000 == de.continent)) || ((de.continent < 100) && (mapid / 10000000 == de.continent)) || ((de.continent < 1000) && (mapid / 1000000 == de.continent))) {
                int itemId = de.itemId;
                if (num == 0) {
                    name.append("当前地图 #r").append(mapid).append("#k - #m").append(mapid).append("# 的全局爆率为:");
                    name.append("\r\n--------------------------------------\r\n");
                }
                String names = new StringBuilder().append("#z").append(itemId).append("#").toString();
                if ((itemId == 0) && (cashServerRate != 0)) {
                    itemId = 4031041;
                    names = new StringBuilder().append(de.Minimum * cashServerRate).append(" - ").append(de.Maximum * cashServerRate).append(" 的抵用卷").toString();
                }
                int chance = de.chance * globalServerRate;
                if (getPlayer().isShowPacket()) {
                    name.append(num + 1).append(") #v").append(itemId).append("#").append(names).append(" - ").append(Integer.valueOf(chance >= 999999 ? 1000000 : chance).doubleValue() / 10000.0D).append("%的爆率. ").append((de.questid > 0) && (MapleQuest.getInstance(de.questid).getName().length() > 0) ? new StringBuilder().append("需要接受任务: ").append(MapleQuest.getInstance(de.questid).getName()).toString() : "").append("\r\n");
                } else {
                    name.append(num + 1).append(") #v").append(itemId).append("#").append(names).append((de.questid > 0) && (MapleQuest.getInstance(de.questid).getName().length() > 0) ? new StringBuilder().append("需要接受任务: ").append(MapleQuest.getInstance(de.questid).getName()).toString() : "").append("\r\n");
                }
                num++;
            }
        }
        if (name.length() > 0) {
            return name.toString();
        }
    }
    return "当前地图没有设置全局爆率。";
}
 

开发者ID:icelemon1314,
项目名称:mapleLemon,
代码行数:38,
代码来源:NPCConversationManager.java

示例2: cleardrops

点赞 2

import server.life.MapleMonsterInformationProvider; //导入依赖的package包/类
public void cleardrops() {
    MapleMonsterInformationProvider.getInstance().clearDrops();
}
 

开发者ID:ergothvs,
项目名称:Lucid2.0,
代码行数:4,
代码来源:NPCConversationManager.java

示例3: checkDrop

点赞 2

import server.life.MapleMonsterInformationProvider; //导入依赖的package包/类
public String checkDrop(MapleCharacter chr, int mobId) {
    final List<MonsterDropEntry> ranks = MapleMonsterInformationProvider.getInstance().retrieveDrop(mobId);
    if (ranks != null && ranks.size() > 0) {
        int num = 0;
        int itemId;
        int ch;
        MonsterDropEntry de;
        StringBuilder name = new StringBuilder();
        for (int i = 0; i < ranks.size(); i++) {
            de = ranks.get(i);
            if (de.chance > 0 && (de.questid <= 0
                    || (de.questid > 0 && MapleQuest.getInstance(de.questid).getName().length() > 0))) {
                itemId = de.itemId;
                if (num == 0) {
                    name.append("Drops for #o").append(mobId).append("#\r\n");
                    name.append("--------------------------------------\r\n");
                }
                String namez = "#z" + itemId + "#";
                if (itemId == 0) { // meso
                    itemId = 4031041; // display sack of cash
                    namez = (de.Minimum * getClient().getChannelServer().getMesoRate(chr.getWorld())) + " to "
                            + (de.Maximum * getClient().getChannelServer().getMesoRate(chr.getWorld())) + " meso";
                }
                ch = de.chance * getClient().getChannelServer().getDropRate(chr.getWorld());
                name.append(num + 1).append(") #v").append(itemId).append("#").append(namez).append(" - ")
                        .append(Integer.valueOf(ch >= 999999 ? 1000000 : ch).doubleValue() / 10000.0)
                        .append("% chance. ")
                        .append(de.questid > 0 && MapleQuest.getInstance(de.questid).getName().length() > 0
                                        ? ("Requires quest " + MapleQuest.getInstance(de.questid).getName()
                                        + " to be started.")
                                        : "")
                        .append("\r\n");
                num++;
            }
        }
        if (name.length() > 0) {
            return name.toString();
        }

    }
    return "No drops was returned.";
}
 

开发者ID:ergothvs,
项目名称:Lucid2.0,
代码行数:43,
代码来源:NPCConversationManager.java

示例4: execute

点赞 2

import server.life.MapleMonsterInformationProvider; //导入依赖的package包/类
@Override
public int execute(MapleClient c, String[] splitted) {
    MapleMonsterInformationProvider.getInstance().clearDrops();
    ReactorScriptManager.getInstance().clearDrops();
    return 1;
}
 

开发者ID:ergothvs,
项目名称:Lucid2.0,
代码行数:7,
代码来源:SuperGMCommand.java

示例5: cleardrops

点赞 2

import server.life.MapleMonsterInformationProvider; //导入依赖的package包/类
public void cleardrops() {
	MapleMonsterInformationProvider.getInstance().clearDrops();
}
 

开发者ID:Maxcloud,
项目名称:Mushy,
代码行数:4,
代码来源:NPCConversationManager.java

示例6: checkDrop

点赞 2

import server.life.MapleMonsterInformationProvider; //导入依赖的package包/类
public String checkDrop(MapleCharacter chr, int mobId) {
	final List<MonsterDropEntry> ranks = MapleMonsterInformationProvider.getInstance().retrieveDrop(mobId);
	if (ranks != null && ranks.size() > 0) {
		int num = 0;
		int itemId;
		int ch;
		MonsterDropEntry de;
		StringBuilder name = new StringBuilder();
		for (int i = 0; i < ranks.size(); i++) {
			de = ranks.get(i);
			if (de.chance > 0 && (de.questid <= 0
					|| (de.questid > 0 && MapleQuest.getInstance(de.questid).getName().length() > 0))) {
				itemId = de.itemId;
				if (num == 0) {
					name.append("Drops for #o").append(mobId).append("#\r\n");
					name.append("--------------------------------------\r\n");
				}
				String namez = "#z" + itemId + "#";
				if (itemId == 0) { // meso
					itemId = 4031041; // display sack of cash
					namez = (de.Minimum * getClient().getChannelServer().getMesoRate(chr.getWorld())) + " to "
							+ (de.Maximum * getClient().getChannelServer().getMesoRate(chr.getWorld())) + " meso";
				}
				ch = de.chance * getClient().getChannelServer().getDropRate(chr.getWorld());
				name.append(num + 1).append(") #v").append(itemId).append("#").append(namez).append(" - ")
						.append(Integer.valueOf(ch >= 999999 ? 1000000 : ch).doubleValue() / 10000.0)
						.append("% chance. ")
						.append(de.questid > 0 && MapleQuest.getInstance(de.questid).getName().length() > 0
								? ("Requires quest " + MapleQuest.getInstance(de.questid).getName()
										+ " to be started.")
								: "")
						.append("\r\n");
				num++;
			}
		}
		if (name.length() > 0) {
			return name.toString();
		}

	}
	return "No drops was returned.";
}
 

开发者ID:Maxcloud,
项目名称:Mushy,
代码行数:43,
代码来源:NPCConversationManager.java

示例7: loadData

点赞 2

import server.life.MapleMonsterInformationProvider; //导入依赖的package包/类
public static void loadData(boolean reload) {
    System.out.println("载入数据(因为数据量大可能比较久而且内存消耗会飙升)");

    System.out.println("加载等级经验数据");
    GameConstants.LoadExp();

    System.out.println("加载排名信息数据");
    MapleGuildRanking.getInstance().load(reload);

    //System.out.println("加载公会数据并清理不存在公会");
    //MapleGuild.loadAll();

    System.out.println("加载任务数据");
    //加载任务信息
    MapleLifeFactory.loadQuestCounts(reload);
    //加载转存到数据库的任务信息
    MapleQuest.initQuests(reload);

    System.out.println("加载爆物数据");
    //加载爆物数据
    MapleMonsterInformationProvider.getInstance().addExtra();
    //加载全域爆物数据
    MapleMonsterInformationProvider.getInstance().load();

    System.out.println("加载道具数据");
    //加载道具信息(从WZ)
    MapleItemInformationProvider.getInstance().runEtc(reload);
    //加载道具信息(从SQL)
    MapleItemInformationProvider.getInstance().runItems(reload);
    //加载发型脸型
    MapleItemInformationProvider.getInstance().loadHairFace(reload);

    System.out.println("加载技能数据");
    //加载技能
    SkillFactory.loadAllSkills(reload);

    MobSkillFactory.getInstance(); //载入怪物技能

    System.out.println("loadSpeedRuns");
    //?
    SpeedRunner.loadSpeedRuns(reload);

    System.out.println("加载商城道具数据");
    //加载商城道具信息
    CashItemFactory.getInstance().initialize(reload);
    System.out.println("数据载入完成!\r\n");
}
 

开发者ID:icelemon1314,
项目名称:mapleLemon,
代码行数:48,
代码来源:Start.java

示例8: getSearchs

点赞 2

import server.life.MapleMonsterInformationProvider; //导入依赖的package包/类
public static Map<Integer, String> getSearchs(SearchType type) {
        if (searchs.containsKey(type)) {
            return searchs.get(type);
        }

//        Map<Integer, String> values = new TreeMap<>((v1, v2) -> v1.compareTo(v2));
        Map<Integer, String> values = new TreeMap();
        switch (type) {
            case 道具:
                for (ItemInformation itemInfo : MapleItemInformationProvider.getInstance().getAllItems()) {
                    values.put(itemInfo.itemId, itemInfo.name);
                }
                break;
            case NPC:
                values = MapleLifeFactory.getNPCNames();
                break;
            case 地圖:
                MapleData data = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath", "wz") + "//" + "String.wz")).getData("Map.img");
                for (MapleData mapAreaData : data.getChildren()) {
                    for (MapleData mapIdData : mapAreaData.getChildren()) {
                        values.put(Integer.parseInt(mapIdData.getName()), "'" + MapleDataTool.getString(mapIdData.getChildByPath("streetName"), "無名稱") + " : " + MapleDataTool.getString(mapIdData.getChildByPath("mapName"), "無名稱") + "'");
                    }
                }
                break;
            case 怪物:
                for (Map.Entry<Integer, String> mob : MapleMonsterInformationProvider.getInstance().getAllMonsters().entrySet()) {
                    values.put(mob.getKey(), mob.getValue());
                }
                break;
            case 任務:
                for (MapleQuest quest : MapleQuest.getAllInstances()) {
                    values.put(quest.getId(), quest.getName());
                }
                break;
            case 技能: {
                for (Skill skill : SkillFactory.getAllSkills()) {
                    values.put(skill.getId(), skill.getName());
                }
                break;
            }
            case 職業:
                for (MapleJob job : MapleJob.values()) {
                    values.put(job.getId(), job.name());
                }
                break;
            case 包頭:
                break;
        }

        searchs.put(type, values);
        return values;
    }
 

开发者ID:icelemon1314,
项目名称:mapleLemon,
代码行数:53,
代码来源:SearchGenerator.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)