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

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

java 3次浏览

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

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

示例1: spawnSummon

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
/**
 * Gets a packet to spawn a special map object.
 *
 * @param summon
 * @param skillLevel The level of the skill used.
 * @param animated Animated spawn?
 * @return The spawn packet for the map object.
 */
public static byte[] spawnSummon(MapleSummon summon, boolean animated) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(25);
    mplew.writeShort(SendOpcode.SPAWN_SPECIAL_MAPOBJECT.getValue());
    mplew.writeInt(summon.getOwner().getId());
    mplew.writeInt(summon.getObjectId());
    mplew.writeInt(summon.getSkill());
    mplew.write(0x0A); //v83
    mplew.write(summon.getSkillLevel());
    mplew.writePos(summon.getPosition());
    mplew.skip(3);
    mplew.write(summon.getMovementType().getValue()); // 0 = don't move, 1 = follow (4th mage summons?), 2/4 = only tele follow, 3 = bird follow
    mplew.write(summon.isPuppet() ? 0 : 1); // 0 and the summon can't attack - but puppets don't attack with 1 either ^.-
    mplew.write(animated ? 0 : 1);
    return mplew.getPacket();
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:24,
代码来源:MaplePacketCreator.java

示例2: handlePacket

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
@Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    //System.out.println(slea.toString());
    Collection<MapleSummon> summons = c.getPlayer().getSummons().values();
    int oid = slea.readInt();
    MapleSummon summon = null;
    for (MapleSummon sum : summons) {
        if (sum.getObjectId() == oid) {
            summon = sum;
        }
    }
    if (summon != null) {
        int skillId = slea.readInt();
        if (skillId == DarkKnight.AURA_OF_BEHOLDER) {
            slea.readShort(); //Not sure.
        } else if (skillId == DarkKnight.HEX_OF_BEHOLDER) {
            slea.readByte(); //Not sure.
        }            //show to others here
    } else {
        c.getPlayer().getSummons().clear();
    }
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:23,
代码来源:BeholderHandler.java

示例3: handlePacket

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    int skillid = slea.readInt(); //Bugged? might not be skillid.
    int unkByte = slea.readByte();
    int damage = slea.readInt();
    int monsterIdFrom = slea.readInt();
    if (SkillFactory.getSkill(skillid) != null) {
        MapleCharacter player = c.getPlayer();
        MapleSummon summon = player.getSummons().get(skillid);
        if (summon != null) {
            summon.addHP(-damage);
            if (summon.getHP() <= 0) {
                player.cancelEffectFromBuffStat(MapleBuffStat.PUPPET);
            }
        }
        player.getMap().broadcastMessage(player, MaplePacketCreator.damageSummon(player.getId(), skillid, damage, unkByte, monsterIdFrom), summon.getPosition());
    }
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:18,
代码来源:DamageSummonHandler.java

示例4: handlePacket

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
    int oid = slea.readInt();
    Point startPos = new Point(slea.readShort(), slea.readShort());
    List<LifeMovementFragment> res = parseMovement(slea);
    MapleCharacter player = c.getPlayer();
    Collection<MapleSummon> summons = player.getSummons().values();
    MapleSummon summon = null;
    for (MapleSummon sum : summons) {
        if (sum.getObjectId() == oid) {
            summon = sum;
            break;
        }
    }
    if (summon != null) {
        updatePosition(res, summon, 0);
        player.getMap().broadcastMessage(player, MaplePacketCreator.moveSummon(player.getId(), oid, startPos, res), summon.getPosition());
    }
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:19,
代码来源:MoveSummonHandler.java

示例5: MoveSummon

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public static final void MoveSummon(final LittleEndianAccessor slea, final MapleCharacter chr) {
    if (chr == null || chr.getMap() == null) {
        return;
    }
    final MapleMapObject obj = chr.getMap().getMapObject(slea.readInt(), MapleMapObjectType.SUMMON);
    if (obj == null) {
        return;
    }
    if (obj instanceof MapleDragon) {
        MoveDragon(slea, chr);
        return;
    }
    final MapleSummon sum = (MapleSummon) obj;
    if (sum.getOwnerId() != chr.getId() || sum.getSkillLevel() <= 0 || sum.getMovementType() == SummonMovementType.STATIONARY) {
        return;
    }
    slea.skip(12); //startPOS
    final List<LifeMovementFragment> res = MovementParse.parseMovement(slea, 4);

    final Point pos = sum.getPosition();
    MovementParse.updatePosition(res, sum, 0);
    if (res.size() > 0) {
        chr.getMap().broadcastMessage(chr, SummonPacket.moveSummon(chr.getId(), sum.getObjectId(), pos, res), sum.getTruePosition());
    }
}
 

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

示例6: RemoveSummon

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public static final void RemoveSummon(final LittleEndianAccessor slea, final MapleClient c) {
    final MapleMapObject obj = c.getPlayer().getMap().getMapObject(slea.readInt(), MapleMapObjectType.SUMMON);
    if (obj == null || !(obj instanceof MapleSummon)) {
        return;
    }
    final MapleSummon summon = (MapleSummon) obj;
    if (summon.getOwnerId() != c.getPlayer().getId() || summon.getSkillLevel() <= 0) {
        c.getPlayer().dropMessage(5, "Error.");
        return;
    }
    if (summon.getSkill() == 35111002 || summon.getSkill() == 35121010) { //rock n shock, amp
        return;
    }
    c.getPlayer().getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
    c.getPlayer().getMap().removeMapObject(summon);
    c.getPlayer().removeVisibleMapObject(summon);
    c.getPlayer().removeSummon(summon);
    if (summon.getSkill() != 35121011) {
        c.getPlayer().cancelEffectFromBuffStat(CharacterTemporaryStat.SUMMON);
        //TODO: Multi Summoning, must do something about hack buffstat
    }
}
 

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

示例7: silentApplyBuff

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public final void silentApplyBuff(final MapleCharacter chr, final long starttime, final int localDuration, final Map<CharacterTemporaryStat, Integer> statup, final int cid) {
    chr.registerEffect(this, starttime, BuffTimer.getInstance().schedule(new CancelEffectAction(chr, this, starttime, statup),
            ((starttime + localDuration) - System.currentTimeMillis())), statup, true, localDuration, cid);

    final SummonMovementType summonMovementType = getSummonMovementType();
    if (summonMovementType != null) {
        final MapleSummon tosummon = new MapleSummon(chr, this, chr.getTruePosition(), summonMovementType);
        if (!tosummon.isPuppet()) {
            chr.getMap().spawnSummon(tosummon);
            chr.addSummon(tosummon);
            tosummon.addHP(info.get(MapleStatInfo.x).shortValue());
            if (isBeholder()) {
                tosummon.addHP((short) 1);
            }
        }
    }
}
 

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

示例8: RemoveSummon

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public static final void RemoveSummon(final LittleEndianAccessor slea, final MapleClient c) {
    final MapleMapObject obj = c.getPlayer().getMap().getMapObject(slea.readInt(), MapleMapObjectType.SUMMON);
    if (obj == null || !(obj instanceof MapleSummon)) {
        return;
    }
    final MapleSummon summon = (MapleSummon) obj;
    if (summon.getOwnerId() != c.getPlayer().getId() || summon.getSkillLevel() <= 0) {
        c.getPlayer().dropMessage(5, "Error.");
        return;
    }
    if (summon.getSkill() == 35111002 || summon.getSkill() == 35121010) { //rock n shock, amp
        return;
    }
    c.getPlayer().getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
    c.getPlayer().getMap().removeMapObject(summon);
    c.getPlayer().removeVisibleMapObject(summon);
    c.getPlayer().removeSummon(summon);
    if (summon.getSkill() != 35121011) {
        c.getPlayer().cancelEffectFromBuffStat(MapleBuffStat.SUMMON);
        //TODO: Multi Summoning, must do something about hack buffstat
    }
}
 

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

示例9: silentApplyBuff

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public final void silentApplyBuff(final MapleCharacter chr, final long starttime, final int localDuration, final Map<MapleBuffStat, Integer> statup, final int cid) {
    chr.registerEffect(this, starttime, BuffTimer.getInstance().schedule(new CancelEffectAction(chr, this, starttime, statup),
            ((starttime + localDuration) - System.currentTimeMillis())), statup, true, localDuration, cid);

    final SummonMovementType summonMovementType = getSummonMovementType();
    if (summonMovementType != null) {
        final MapleSummon tosummon = new MapleSummon(chr, this, chr.getTruePosition(), summonMovementType);
        if (!tosummon.isPuppet()) {
            chr.getMap().spawnSummon(tosummon);
            chr.addSummon(tosummon);
            tosummon.addHP(info.get(MapleStatInfo.x).shortValue());
            if (isBeholder()) {
                tosummon.addHP((short) 1);
            }
        }
    }
}
 

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

示例10: silentApplyBuff

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public void silentApplyBuff(MapleCharacter chr, long starttime, int localDuration, List<Pair<MapleBuffStat, Integer>> statup, int chrId) {
    int maskedDuration = 0;
    int newDuration = (int) (starttime + localDuration - System.currentTimeMillis());
    if (is终极无限()) {
        maskedDuration = alchemistModifyVal(chr, 4000, false);
    }
    ScheduledFuture schedule = Timer.BuffTimer.getInstance().schedule(new CancelEffectAction(chr, this, starttime, statup), newDuration);
    chr.registerEffect(this, starttime, schedule, statup, true, localDuration, chrId);
    SummonMovementType summonMovementType = getSummonMovementType();
    if (summonMovementType != null) {
        MapleSummon summon = new MapleSummon(chr, this, chr.getTruePosition(), summonMovementType);
        if (!summon.is替身术()) {
            chr.getMap().spawnSummon(summon);
            chr.addSummon(summon);
            summon.addSummonHp((this.info.get(MapleStatInfo.x)).shortValue());
            if (is灵魂助力()) {
                summon.addSummonHp(1);
            }
        }
    }
}
 

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

示例11: spawnSummon

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
/**
 * 召唤召唤兽
 * @param summon
 * @param animated
 * @return
 */
public static byte[] spawnSummon(MapleSummon summon, boolean animated) {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

    mplew.write(SendPacketOpcode.SPAWN_SUMMON.getValue());
    mplew.writeInt(summon.getOwnerId());
    mplew.writeInt(summon.getSkillId());
    mplew.write(summon.getSkillLevel());
    mplew.writePos(summon.getPosition());
    mplew.write(0); // ?
    mplew.writeShort(0);
    mplew.write(summon.getMovementType().getValue());
    mplew.write(animated ? 1 : 0);

    return mplew.getPacket();
}
 

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

示例12: MoveSummon

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public static final void MoveSummon(final LittleEndianAccessor slea, final MapleCharacter chr) {
    if (chr == null || chr.getMap() == null) {
        return;
    }
    final MapleMapObject obj = chr.getMap().getMapObject(slea.readInt(), MapleMapObjectType.SUMMON);
    if (obj == null) {
        return;
    }
    if (obj instanceof MapleDragon) {
        MoveDragon(slea, chr);
        return;
    }
    final MapleSummon sum = (MapleSummon) obj;
    if (sum.getOwnerId() != chr.getId() || sum.getSkillLevel() <= 0 || sum.getMovementType() == SummonMovementType.STATIONARY) {
        return;
    }
    slea.skip(16); //startPOS
    final List<LifeMovementFragment> res = MovementParse.parseMovement(slea, 4);

    final Point pos = sum.getPosition();
    MovementParse.updatePosition(res, sum, 0);
    if (res.size() > 0) {
        chr.getMap().broadcastMessage(chr, SummonPacket.moveSummon(chr.getId(), sum.getObjectId(), pos, res), sum.getTruePosition());
    }
}
 

开发者ID:skorch37,
项目名称:Asteria,
代码行数:26,
代码来源:SummonHandler.java

示例13: silentApplyBuff

点赞 3

import server.maps.MapleSummon; //导入依赖的package包/类
public final void silentApplyBuff(final MapleCharacter chr, final long starttime, final int localDuration, final Map<MapleBuffStat, Integer> statup, final int cid) {
    chr.registerEffect(this, starttime, BuffTimer.getInstance().schedule(new CancelEffectAction(chr, this, starttime, statup),
            ((starttime + localDuration) - System.currentTimeMillis())), statup, true, localDuration, cid);

    final SummonMovementType summonMovementType = getSummonMovementType();
    if (summonMovementType != null) {
        final MapleSummon tosummon = new MapleSummon(chr, this, chr.getTruePosition(), summonMovementType);
        if (!tosummon.isPuppet()) {
            chr.getCheatTracker().resetSummonAttack();
            chr.getMap().spawnSummon(tosummon);
            chr.addSummon(tosummon);
            tosummon.addHP(info.get(MapleStatInfo.x).shortValue());
            if (isBeholder()) {
                tosummon.addHP((short) 1);
            }
        }
    }
}
 

开发者ID:skorch37,
项目名称:Asteria,
代码行数:19,
代码来源:MapleStatEffect.java

示例14: silentApplyBuff

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public void silentApplyBuff(MapleCharacter chr, long starttime) {
    int localDuration = duration;
    localDuration = alchemistModifyVal(chr, localDuration, false);
    CancelEffectAction cancelAction = new CancelEffectAction(chr, this, starttime);
    ScheduledFuture<?> schedule = TimerManager.getInstance().schedule(cancelAction, ((starttime + localDuration) - System.currentTimeMillis()));
    chr.registerEffect(this, starttime, schedule);
    SummonMovementType summonMovementType = getSummonMovementType();
    if (summonMovementType != null) {
        final MapleSummon tosummon = new MapleSummon(chr, sourceid, chr.getPosition(), summonMovementType);
        if (!tosummon.isStationary()) {
            chr.addSummon(sourceid, tosummon);
            tosummon.addHP(x);
        }
    }
    if (sourceid == Corsair.BATTLE_SHIP) {
        chr.announce(MaplePacketCreator.skillCooldown(5221999, chr.getBattleshipHp()));
    }
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:19,
代码来源:MapleStatEffect.java

示例15: removeSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
/**
 * Gets a packet to remove a special map object.
 *
 * @param summon
 * @param animated Animated removal?
 * @return The packet removing the object.
 */
public static byte[] removeSummon(MapleSummon summon, boolean animated) {
    final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter(11);
    mplew.writeShort(SendOpcode.REMOVE_SPECIAL_MAPOBJECT.getValue());
    mplew.writeInt(summon.getOwner().getId());
    mplew.writeInt(summon.getObjectId());
    mplew.write(animated ? 4 : 1); // ?
    return mplew.getPacket();
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:16,
代码来源:MaplePacketCreator.java

示例16: addSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public void addSummon(MapleSummon s) {
    summonsLock.writeLock().lock();
    try {
        summons.add(s);
    } finally {
        summonsLock.writeLock().unlock();
    }
}
 

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

示例17: removeSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public void removeSummon(MapleSummon s) {
    summonsLock.writeLock().lock();
    try {
        summons.remove(s);
    } finally {
        summonsLock.writeLock().unlock();
    }
}
 

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

示例18: DamageSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public static final void DamageSummon(final LittleEndianAccessor slea, final MapleCharacter chr) {
    final int unkByte = slea.readByte();
    final int damage = slea.readInt();
    final int monsterIdFrom = slea.readInt();
    //       slea.readByte(); // stance

    final Iterator<MapleSummon> iter = chr.getSummonsReadLock().iterator();
    MapleSummon summon;
    boolean remove = false;
    try {
        while (iter.hasNext()) {
            summon = iter.next();
            if (summon.isPuppet() && summon.getOwnerId() == chr.getId() && damage > 0) { //We can only have one puppet(AFAIK O.O) so this check is safe.
                summon.addHP((short) -damage);
                if (summon.getHP() <= 0) {
                    remove = true;
                }
                chr.getMap().broadcastMessage(chr, SummonPacket.damageSummon(chr.getId(), summon.getSkill(), damage, unkByte, monsterIdFrom), summon.getTruePosition());
                break;
            }
        }
    } finally {
        chr.unlockSummonsReadLock();
    }
    if (remove) {
        chr.cancelEffectFromBuffStat(CharacterTemporaryStat.PUPPET);
    }
}
 

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

示例19: removeSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public static byte[] removeSummon(MapleSummon summon, boolean animated) {
    PacketWriter pw = new PacketWriter();

    pw.writeShort(SendPacketOpcode.REMOVE_SUMMON.getValue());
    pw.writeInt(summon.getOwnerId());
    pw.writeInt(summon.getObjectId());
    if (animated) {
        switch (summon.getSkill()) {
            case 35121003:
                pw.write(10);
                break;
            case 33101008:
            case 35111001:
            case 35111002:
            case 35111005:
            case 35111009:
            case 35111010:
            case 35111011:
            case 35121009:
            case 35121010:
            case 35121011:
                pw.write(5);
                break;
            default:
                pw.write(4);
                break;
        }
    } else {
        pw.write(1);
    }

    return pw.getPacket();
}
 

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

示例20: DamageSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public static final void DamageSummon(final LittleEndianAccessor slea, final MapleCharacter chr) {
    final int unkByte = slea.readByte();
    final int damage = slea.readInt();
    final int monsterIdFrom = slea.readInt();
    //       slea.readByte(); // stance

    final Iterator<MapleSummon> iter = chr.getSummonsReadLock().iterator();
    MapleSummon summon;
    boolean remove = false;
    try {
        while (iter.hasNext()) {
            summon = iter.next();
            if (summon.isPuppet() && summon.getOwnerId() == chr.getId() && damage > 0) { //We can only have one puppet(AFAIK O.O) so this check is safe.
                summon.addHP((short) -damage);
                if (summon.getHP() <= 0) {
                    remove = true;
                }
                chr.getMap().broadcastMessage(chr, SummonPacket.damageSummon(chr.getId(), summon.getSkill(), damage, unkByte, monsterIdFrom), summon.getTruePosition());
                break;
            }
        }
    } finally {
        chr.unlockSummonsReadLock();
    }
    if (remove) {
        chr.cancelEffectFromBuffStat(MapleBuffStat.PUPPET);
    }
}
 

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

示例21: removeSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public static byte[] removeSummon(MapleSummon summon, boolean animated) {
	PacketWriter pw = new PacketWriter();

	pw.writeShort(SendPacketOpcode.REMOVE_SUMMON.getValue());
	pw.writeInt(summon.getOwnerId());
	pw.writeInt(summon.getObjectId());
	if (animated) {
		switch (summon.getSkill()) {
		case 35121003:
			pw.write(10);
			break;
		case 33101008:
		case 35111001:
		case 35111002:
		case 35111005:
		case 35111009:
		case 35111010:
		case 35111011:
		case 35121009:
		case 35121010:
		case 35121011:
			pw.write(5);
			break;
		default:
			pw.write(4);
			break;
		}
	} else {
		pw.write(1);
	}

	return pw.getPacket();
}
 

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

示例22: addSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public void addSummon(MapleSummon s) {
    this.summonsLock.writeLock().lock();
    try {
        this.summons.put(s.getSkillId(),s);
    } finally {
        this.summonsLock.writeLock().unlock();
    }
}
 

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

示例23: MoveSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public static void MoveSummon(SeekableLittleEndianAccessor slea, MapleCharacter chr) {
    // 52
    // 5D 78 2F 00
    // E7 FE 1D 01
    // 04 00 E7 FE 1B 01 00 00 FE FF 00 00 0C 3C 00 00 E7 FE 34 01 00 00 3C 00 00 00 0C 68 01 01 00 00 38 FF 0C 00 00 00 E7 FE 26 01 00 00 80 FF 00 00 0C 5A 00 00
    if ((chr == null) || (chr.getMap() == null)) {
        return;
    }
    MapleSummon sum = chr.getSummons().get(slea.readInt());
    if (sum == null) {
        FileoutputUtil.log("找不到地图物体:召唤兽!");
        return;
    }
    if ((sum.getOwnerId() != chr.getId()) || (sum.getSkillLevel() <= 0) || (sum.getMovementType() == SummonMovementType.不会移动)) {
        return;
    }
    Point startPos = new Point(slea.readShort(), slea.readShort());
    List res = MovementParse.parseMovement(slea, 4);
    Point pos = sum.getPosition();
    MovementParse.updatePosition(res, sum, 0);
    if (res.size() > 0) {
        if (slea.available() != 1L) {
            FileoutputUtil.log("slea.available() != 1 (召唤兽移动错误) 剩余封包长度: " + slea.available());
            FileoutputUtil.log(FileoutputUtil.Movement_Sumon, "slea.available() = " + slea.available() + " (召唤兽移动错误) 封包: " + slea.toString(true));
            return;
        }
        chr.getMap().broadcastMessage(chr, SummonPacket.moveSummon(chr.getId(), sum.getSkillId(), pos, res), sum.getTruePosition());
    }
}
 

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

示例24: DamageSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
/**
 * 召唤物受到伤害
 * @param slea
 * @param chr
 */
public static void DamageSummon(SeekableLittleEndianAccessor slea, MapleCharacter chr) {
    // 54 FA FE 30 00 FF 00 00 00 00 04 87 01 00 00
    if ((chr == null) || (!chr.isAlive()) || (chr.getMap() == null)) {
        return;
    }
    MapleSummon summon = chr.getSummons().get(slea.readInt());
    if ((summon == null) || (summon.getOwnerId() != chr.getId())) {
        FileoutputUtil.log("找不到地图物体:召唤兽!");
        return;
    }
    int type = slea.readByte();
    int damage = slea.readInt();
    int monsterIdFrom = slea.readInt();
    slea.skip(1);
    boolean remove = false;
    if ((summon.is替身术()) && (damage > 0)) {
        summon.addSummonHp(-damage);
        if (summon.getSummonHp() <= 0) {
            remove = true;
        }
        chr.getMap().broadcastMessage(chr, SummonPacket.damageSummon(chr.getId(), summon.getSkillId(), damage, type, monsterIdFrom), summon.getTruePosition());
    }
    if (remove) {
        chr.dispelSkill(summon.getSkillId());
    }
}
 

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

示例25: RemoveSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public static void RemoveSummon(SeekableLittleEndianAccessor slea, MapleClient c) {
    MapleSummon summon = c.getPlayer().getSummons().get(slea.readInt());
    if (summon ==null || (summon.getOwnerId() != c.getPlayer().getId()) || (summon.getSkillLevel() <= 0)) {
        c.getPlayer().dropMessage(5, "移除召唤兽出现错误.");
        return;
    }
    if (c.getPlayer().isShowPacket()) {
        c.getPlayer().dropSpouseMessage(10, "收到移除召唤兽信息 - 召唤兽技能ID: " + summon.getSkillId() + " 技能名字 " + SkillFactory.getSkillName(summon.getSkillId()));
    }
    c.getPlayer().getMap().broadcastMessage(SummonPacket.removeSummon(summon, false));
    c.getPlayer().getMap().removeMapObject(summon);
    c.getPlayer().removeVisibleMapObject(summon);
    c.getPlayer().removeSummon(summon.getSkillId());
    c.getPlayer().dispelSkill(summon.getSkillId());
}
 

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

示例26: SubSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public static void SubSummon(SeekableLittleEndianAccessor slea, MapleCharacter chr) {
    MapleSummon sum = chr.getSummons().get(slea.readInt());
    if (sum == null || (sum.getOwnerId() != chr.getId()) || (sum.getSkillLevel() <= 0) || (!chr.isAlive())) {
        return;
    }
    switch (sum.getSkillId()) {
        case 1301013:
            Skill bHealing = SkillFactory.getSkill(slea.readInt());
            int bHealingLvl = chr.getTotalSkillLevel(bHealing);
            if ((bHealingLvl <= 0) || (bHealing == null)) {
                return;
            }
            MapleStatEffect healEffect = bHealing.getEffect(bHealingLvl);
            if (bHealing.getId() == 1310016) {
                healEffect.applyTo(chr);
            } else if (bHealing.getId() == 1301013) {
                if (!chr.canSummon(healEffect.getX() * 1000)) {
                    return;
                }
                int healHp = Math.min(1000, healEffect.getHp() * chr.getLevel());
                chr.addHP(healHp);
            }
            chr.getClient().getSession().write(MaplePacketCreator.showOwnBuffEffect(sum.getSkillId(), 3, chr.getLevel(), bHealingLvl));//2+1 119
            chr.getMap().broadcastMessage(SummonPacket.summonSkill(chr.getId(), sum.getSkillId(), bHealing.getId() == 1301013 ? 5 : Randomizer.nextInt(3) + 6));
            chr.getMap().broadcastMessage(chr, MaplePacketCreator.showBuffeffect(chr, sum.getSkillId(), 3, chr.getLevel(), bHealingLvl), false);//2+1 119
    }
}
 

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

示例27: removeSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
/**
 * 移除召唤兽
 * @param summon
 * @param animated
 * @return
 */
public static byte[] removeSummon(MapleSummon summon, boolean animated) {
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();

    mplew.write(SendPacketOpcode.REMOVE_SUMMON.getValue());
    mplew.writeInt(summon.getOwnerId());
    mplew.writeInt(summon.getSkillId());
    mplew.write(animated ? 4 : summon.getRemoveStatus());

    return mplew.getPacket();
}
 

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

示例28: addSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public void addSummon(int id, MapleSummon summon) {
    summons.put(id, summon);
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:4,
代码来源:MapleCharacter.java

示例29: deregisterBuffStats

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
private void deregisterBuffStats(List<MapleBuffStat> stats) {
    synchronized (stats) {
        List<MapleBuffStatValueHolder> effectsToCancel = new ArrayList<>(stats.size());
        for (MapleBuffStat stat : stats) {
            MapleBuffStatValueHolder mbsvh = effects.get(stat);
            if (mbsvh != null) {
                effects.remove(stat);
                boolean addMbsvh = true;
                for (MapleBuffStatValueHolder contained : effectsToCancel) {
                    if (mbsvh.startTime == contained.startTime && contained.effect == mbsvh.effect) {
                        addMbsvh = false;
                    }
                }
                if (addMbsvh) {
                    effectsToCancel.add(mbsvh);
                }
                if (stat == MapleBuffStat.RECOVERY) {
                    if (recoveryTask != null) {
                        recoveryTask.cancel(false);
                        recoveryTask = null;
                    }
                } else if (stat == MapleBuffStat.SUMMON || stat == MapleBuffStat.PUPPET) {
                    int summonId = mbsvh.effect.getSourceId();
                    MapleSummon summon = summons.get(summonId);
                    if (summon != null) {
                        getMap().broadcastMessage(MaplePacketCreator.removeSummon(summon, true), summon.getPosition());
                        getMap().removeMapObject(summon);
                        removeVisibleMapObject(summon);
                        summons.remove(summonId);
                    }
                    if (summon.getSkill() == DarkKnight.BEHOLDER) {
                        if (beholderHealingSchedule != null) {
                            beholderHealingSchedule.cancel(false);
                            beholderHealingSchedule = null;
                        }
                        if (beholderBuffSchedule != null) {
                            beholderBuffSchedule.cancel(false);
                            beholderBuffSchedule = null;
                        }
                    }
                } else if (stat == MapleBuffStat.DRAGONBLOOD) {
                    dragonBloodSchedule.cancel(false);
                    dragonBloodSchedule = null;
                }
            }
        }
        for (MapleBuffStatValueHolder cancelEffectCancelTasks : effectsToCancel) {
            if (cancelEffectCancelTasks.schedule != null) {
                cancelEffectCancelTasks.schedule.cancel(false);
            }
        }
    }
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:54,
代码来源:MapleCharacter.java

示例30: getSummons

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public Map<Integer, MapleSummon> getSummons() {
    return summons;
}
 

开发者ID:NovaStory,
项目名称:AeroStory,
代码行数:4,
代码来源:MapleCharacter.java

示例31: deregisterBuffStats

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
private boolean deregisterBuffStats(List<CharacterTemporaryStat> stats) {
    boolean clonez = false;
    List<MapleBuffStatValueHolder> effectsToCancel = new ArrayList<>(stats.size());
    for (CharacterTemporaryStat stat : stats) {
        final MapleBuffStatValueHolder mbsvh = effects.remove(stat);
        if (mbsvh != null) {
            boolean addMbsvh = true;
            for (MapleBuffStatValueHolder contained : effectsToCancel) {
                if (mbsvh.startTime == contained.startTime && contained.effect == mbsvh.effect) {
                    addMbsvh = false;
                }
            }
            if (addMbsvh) {
                effectsToCancel.add(mbsvh);
            }
            if (stat == CharacterTemporaryStat.SUMMON || stat == CharacterTemporaryStat.PUPPET || stat == CharacterTemporaryStat.REAPER || stat == CharacterTemporaryStat.Beholder || stat == CharacterTemporaryStat.DamR || stat == CharacterTemporaryStat.RAINING_MINES || stat == CharacterTemporaryStat.IndiePAD) {
                final int summonId = mbsvh.effect.getSourceId();
                final List<MapleSummon> toRemove = new ArrayList<>();
                visibleMapObjectsLock.writeLock().lock(); //We need to lock this later on anyway so do it now to prevent deadlocks.
                summonsLock.writeLock().lock();
                try {
                    for (MapleSummon summon : summons) {
                        if (summon.getSkill() == summonId || (stat == CharacterTemporaryStat.RAINING_MINES && summonId == 33101008) || (summonId == 35121009 && summon.getSkill() == 35121011) || ((summonId == 86 || summonId == 88 || summonId == 91 || summonId == 180 || summonId == 96) && summon.getSkill() == summonId + 999) || ((summonId == 1085 || summonId == 1087 || summonId == 1090 || summonId == 1179 || summonId == 1154) && summon.getSkill() == summonId - 999)) { //removes bots n tots
                            map.broadcastMessage(SummonPacket.removeSummon(summon, true));
                            map.removeMapObject(summon);
                            visibleMapObjects.remove(summon);
                            toRemove.add(summon);
                        }
                    }
                    for (MapleSummon s : toRemove) {
                        summons.remove(s);
                    }
                } finally {
                    summonsLock.writeLock().unlock();
                    visibleMapObjectsLock.writeLock().unlock(); //lolwut
                }
                if (summonId == 3111005 || summonId == 3211005) {
                    cancelEffectFromBuffStat(CharacterTemporaryStat.SpiritLink);
                }
            } else if (stat == CharacterTemporaryStat.DRAGONBLOOD) {
                lastDragonBloodTime = 0;
            } else if (stat == CharacterTemporaryStat.Regen || mbsvh.effect.getSourceId() == 35121005) {
                lastRecoveryTime = 0;
            } else if (stat == CharacterTemporaryStat.StopForceAtomInfo || stat == CharacterTemporaryStat.ArcaneAim) {
                linkMobs.clear();
            } else if (stat == CharacterTemporaryStat.ILLUSION) {
                disposeClones();
                clonez = true;
            }
        }
    }
    for (MapleBuffStatValueHolder cancelEffectCancelTasks : effectsToCancel) {
        if (getBuffStats(cancelEffectCancelTasks.effect, cancelEffectCancelTasks.startTime).isEmpty()) {
            if (cancelEffectCancelTasks.schedule != null) {
                cancelEffectCancelTasks.schedule.cancel(false);
            }
        }
    }
    return clonez;
}
 

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

示例32: sendSpawnData

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
@Override
public void sendSpawnData(MapleClient client) {
    if (client.getPlayer().allowedToTarget(this)) {
        //if (client.getPlayer() != this)
        // client.getSession().write(CField.spawnPlayerMapobject(this));

        for (final MaplePet pet : pets) {
            if (pet.getSummoned()) {
                client.getSession().write(PetPacket.showPet(this, pet, false, false));
            }
        }
        for (final WeakReference<MapleCharacter> chr : clones) {
            if (chr.get() != null) {
                chr.get().sendSpawnData(client);
            }
        }
        if (dragon != null) {
            client.getSession().write(CField.spawnDragon(dragon));
        }
        if (haku != null) {
            client.getSession().write(CField.spawnHaku(haku));
        }
        if (android != null) {
            client.getSession().write(CField.spawnAndroid(this, android));
        }
        if (summonedFamiliar != null) {
            client.getSession().write(CField.spawnFamiliar(summonedFamiliar, true, true));
        }
        if (summons != null && summons.size() > 0) {
            summonsLock.readLock().lock();
            try {
                for (final MapleSummon summon : summons) {
                    client.getSession().write(SummonPacket.spawnSummon(summon, false));
                }
            } finally {
                summonsLock.readLock().unlock();
            }
        }
        if (followid > 0 && followon) {
            client.getSession().write(CField.followEffect(followinitiator ? followid : id, followinitiator ? id : followid, null));
        }
    }
}
 

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

示例33: getSummonsReadLock

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public List<MapleSummon> getSummonsReadLock() {
    summonsLock.readLock().lock();
    return summons;
}
 

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

示例34: SubSummon

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
public static final void SubSummon(final LittleEndianAccessor slea, final MapleCharacter chr) {
    final MapleMapObject obj = chr.getMap().getMapObject(slea.readInt(), MapleMapObjectType.SUMMON);
    if (obj == null || !(obj instanceof MapleSummon)) {
        return;
    }
    final MapleSummon sum = (MapleSummon) obj;
    if (sum == null || sum.getOwnerId() != chr.getId() || sum.getSkillLevel() <= 0 || !chr.isAlive()) {
        return;
    }
    switch (sum.getSkill()) {
        case 35121009:
            if (!chr.canSummon(2000)) {
                return;
            }
            final int skillId = slea.readInt(); // 35121009?
            if (sum.getSkill() != skillId) {
                return;
            }
            slea.skip(1); // 0E?
            slea.skip(4); // update tick
            for (int i = 0; i < 3; i++) {
                final MapleSummon tosummon = new MapleSummon(chr, SkillFactory.getSkill(35121011).getEffect(sum.getSkillLevel()), new Point(sum.getTruePosition().x, sum.getTruePosition().y - 5), SummonMovementType.WALK_STATIONARY);
                chr.getMap().spawnSummon(tosummon);
                chr.addSummon(tosummon);
            }
            break;
        case 35111011: //healing
            if (!chr.canSummon(1000)) {
                return;
            }
            chr.addHP((int) (chr.getStat().getCurrentMaxHp() * SkillFactory.getSkill(sum.getSkill()).getEffect(sum.getSkillLevel()).getHp() / 100.0));
            chr.getClient().getSession().write(EffectPacket.showOwnBuffEffect(sum.getSkill(), 2, chr.getLevel(), sum.getSkillLevel()));
            chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr.getId(), sum.getSkill(), 2, chr.getLevel(), sum.getSkillLevel()), false);
            break;
        case 1321007: //beholder
        case 1301013: // Evil Eye
        case 1311013: // Evil Eye of Domination
            Skill bHealing = SkillFactory.getSkill(slea.readInt());
            final int bHealingLvl = chr.getTotalSkillLevel(bHealing);
            if (bHealingLvl <= 0 || bHealing == null) {
                return;
            }
            final MapleStatEffect healEffect = bHealing.getEffect(bHealingLvl);
            if (bHealing.getId() == 1320009) {
                healEffect.applyTo(chr);
            } else if (bHealing.getId() == 1320008) {
                if (!chr.canSummon(healEffect.getX() * 1000)) {
                    return;
                }
                chr.addHP(healEffect.getHp());
            }
            chr.getClient().getSession().write(EffectPacket.showOwnBuffEffect(sum.getSkill(), 2, chr.getLevel(), bHealingLvl));
            chr.getMap().broadcastMessage(SummonPacket.summonSkill(chr.getId(), sum.getSkill(), bHealing.getId() == 1320008 ? 5 : (Randomizer.nextInt(3) + 6)));
            chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr.getId(), sum.getSkill(), 2, chr.getLevel(), bHealingLvl), false);
            break;
    }
    if (GameConstants.isAngel(sum.getSkill())) {
        if (sum.getSkill() % 10000 == 1087) {
            MapleItemInformationProvider.getInstance().getItemEffect(2022747).applyTo(chr);
        } else if (sum.getSkill() % 10000 == 1179) {
            MapleItemInformationProvider.getInstance().getItemEffect(2022823).applyTo(chr);
        } else {
            MapleItemInformationProvider.getInstance().getItemEffect(2022746).applyTo(chr);
        }
        chr.getClient().getSession().write(EffectPacket.showOwnBuffEffect(sum.getSkill(), 2, 2, 1));
        chr.getMap().broadcastMessage(chr, EffectPacket.showBuffeffect(chr.getId(), sum.getSkill(), 2, 2, 1), false);
    }
}
 

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

示例35: spawnMonster

点赞 2

import server.maps.MapleSummon; //导入依赖的package包/类
@Override
public final MapleMonster spawnMonster(final MapleMap map) {
    final MapleMonster mob = new MapleMonster(id, monster);
    mob.setPosition(pos);
    mob.setCy(pos.y);
    mob.setRx0(pos.x - 50);
    mob.setRx1(pos.x + 50); //these dont matter for mobs
    mob.setFh(fh);
    mob.setF(f);
    mob.setCarnivalTeam(carnivalTeam);
    if (level > -1) {
        mob.changeLevel(level);
    }
    spawnedMonsters.incrementAndGet();
    mob.addListener(new MonsterListener() {

        @Override
        public void monsterKilled() {
            nextPossibleSpawn = System.currentTimeMillis();

            if (mobTime > 0) {
                nextPossibleSpawn += mobTime;
            }
            spawnedMonsters.decrementAndGet();
        }
    });
    map.spawnMonster(mob, -2);
    if (carnivalTeam > -1) {
        for (MapleReactor r : map.getAllReactor()) { //parsing through everytime a monster is spawned? not good idea
            if (r.getName().startsWith(String.valueOf(carnivalTeam)) && r.getReactorId() == (9980000 + carnivalTeam) && r.getState() < 5) {
                final int num = Integer.parseInt(r.getName().substring(1, 2)); //00, 01, etc
                final MCSkill skil = MapleCarnivalFactory.getInstance().getGuardian(num);
                if (skil != null) {
                    skil.getSkill().applyEffect(null, mob, false);
                }
            }
        }
    }
    for (MapleSummon s : map.getAllSummons()) {
        if (s.getSkill() == 35111005) {
            final MapleStatEffect effect = SkillFactory.getSkill(s.getSkill()).getEffect(s.getSkillLevel());
            for (Map.Entry<MonsterStatus, Integer> stat : effect.getMonsterStati().entrySet()) {
                mob.applyStatus(s.getOwner(), new MonsterStatusEffect(stat.getKey(), stat.getValue(), s.getSkill(), null, false), false, effect.getDuration(), true, effect);
            }
            break;
        }
    }
    if (msg != null) {
        map.broadcastMessage(CWvsContext.broadcastMsg(6, msg));
    }
    return mob;
}
 

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


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