本文整理汇总了Java中tools.packet.CWvsContext.BuffPacket类的典型用法代码示例。如果您正苦于以下问题:Java BuffPacket类的具体用法?Java BuffPacket怎么用?Java BuffPacket使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BuffPacket类属于tools.packet.CWvsContext包,在下文中一共展示了BuffPacket类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: giveDebuff
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public void giveDebuff(MapleDisease disease, int x, long duration, int skillid, int level) {
if ((this.map != null) && (!hasDisease(disease))) {
if ((disease != MapleDisease.SEDUCE) && (disease != MapleDisease.STUN) && (disease != MapleDisease.FLAG)
&& (getBuffedValue(CharacterTemporaryStat.AdvancedBless) != null)) {
return;
}
int mC = getBuffSource(CharacterTemporaryStat.Mechanic);
if ((mC > 0) && (mC != 35121005)) {
return;
}
if ((this.stats.ASR > 0) && (Randomizer.nextInt(100) < this.stats.ASR)) {
return;
}
this.diseases.put(disease, new MapleDiseaseValueHolder(disease, System.currentTimeMillis(), duration - this.stats.decreaseDebuff));
this.client.getSession().write(CWvsContext.BuffPacket.giveDebuff(disease, x, skillid, level, (int) duration));
this.map.broadcastMessage(this, CWvsContext.BuffPacket.giveForeignDebuff(this.id, disease, skillid, level, x), false);
if ((x > 0) && (disease == MapleDisease.POISON)) {
addHP((int) (-(x * ((duration - this.stats.decreaseDebuff) / 1000L))));
}
}
}
示例2: handleExtraPVP
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public final void handleExtraPVP(MapleCharacter applyfrom, MapleCharacter chr) {
if (sourceid == 2311005 || sourceid == 5121005 || sourceid == 1201006 || (GameConstants.isBeginnerJob(sourceid / 10000) && sourceid % 10000 == 104)) { //doom, threaten, snatch
final long starttime = System.currentTimeMillis();
final int localsourceid = sourceid == 5121005 ? 90002000 : sourceid;
final Map<CharacterTemporaryStat, Integer> localstatups = new EnumMap<>(CharacterTemporaryStat.class);
if (sourceid == 2311005) {
localstatups.put(CharacterTemporaryStat.Morph, 7);
} else if (sourceid == 1201006) {
localstatups.put(CharacterTemporaryStat.THREATEN_PVP, (int) level);
} else if (sourceid == 5121005) {
localstatups.put(CharacterTemporaryStat.SNATCH, 1);
} else {
localstatups.put(CharacterTemporaryStat.Morph, info.get(MapleStatInfo.x));
}
chr.getClient().getSession().write(BuffPacket.giveBuff(localsourceid, getDuration(), localstatups, this));
chr.registerEffect(this, starttime, BuffTimer.getInstance().schedule(new CancelEffectAction(chr, this, starttime, localstatups), isSubTime(sourceid) ? getSubTime() : getDuration()), localstatups, false, getDuration(), applyfrom.getId());
}
}
示例3: applyEnergyBuff
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public final void applyEnergyBuff(final MapleCharacter applyto, final boolean infinity, int targets) {
final long starttime = System.currentTimeMillis();
if (infinity) {
applyto.getClient().getSession().write(BuffPacket.giveEnergyChargeTest(0, info.get(MapleStatInfo.time) / 1000, targets));
applyto.registerEffect(this, starttime, null, applyto.getId());
} else {
final EnumMap<CharacterTemporaryStat, Integer> stat = new EnumMap<>(CharacterTemporaryStat.class);
stat.put(CharacterTemporaryStat.EnergyCharged, 10000);
applyto.cancelEffect(this, true, -1, stat);
applyto.getMap().broadcastMessage(applyto, BuffPacket.giveEnergyChargeTest(applyto.getId(), 10000, info.get(MapleStatInfo.time) / 1000), false);
final CancelEffectAction cancelAction = new CancelEffectAction(applyto, this, starttime, stat);
final ScheduledFuture<?> schedule = BuffTimer.getInstance().schedule(cancelAction, ((starttime + info.get(MapleStatInfo.time)) - System.currentTimeMillis()));
applyto.registerEffect(this, starttime, schedule, stat, false, info.get(MapleStatInfo.time), applyto.getId());
}
}
示例4: giveDebuff
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public void giveDebuff(MapleDisease disease, int x, long duration, int skillid, int level) {
if ((this.map != null) && (!hasDisease(disease))) {
if ((disease != MapleDisease.SEDUCE) && (disease != MapleDisease.STUN) && (disease != MapleDisease.FLAG)
&& (getBuffedValue(MapleBuffStat.AdvancedBless) != null)) {
return;
}
int mC = getBuffSource(MapleBuffStat.Mechanic);
if ((mC > 0) && (mC != 35121005)) {
return;
}
if ((this.stats.ASR > 0) && (Randomizer.nextInt(100) < this.stats.ASR)) {
return;
}
this.diseases.put(disease, new MapleDiseaseValueHolder(disease, System.currentTimeMillis(), duration - this.stats.decreaseDebuff));
this.client.getSession().write(CWvsContext.BuffPacket.giveDebuff(disease, x, skillid, level, (int) duration));
this.map.broadcastMessage(this, CWvsContext.BuffPacket.giveForeignDebuff(this.id, disease, skillid, level, x), false);
if ((x > 0) && (disease == MapleDisease.POISON)) {
addHP((int) (-(x * ((duration - this.stats.decreaseDebuff) / 1000L))));
}
}
}
示例5: handleExtraPVP
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public final void handleExtraPVP(MapleCharacter applyfrom, MapleCharacter chr) {
if (sourceid == 2311005 || sourceid == 5121005 || sourceid == 1201006 || (GameConstants.isBeginnerJob(sourceid / 10000) && sourceid % 10000 == 104)) { //doom, threaten, snatch
final long starttime = System.currentTimeMillis();
final int localsourceid = sourceid == 5121005 ? 90002000 : sourceid;
final Map<MapleBuffStat, Integer> localstatups = new EnumMap<>(MapleBuffStat.class);
if (sourceid == 2311005) {
localstatups.put(MapleBuffStat.Morph, 7);
} else if (sourceid == 1201006) {
localstatups.put(MapleBuffStat.THREATEN_PVP, (int) level);
} else if (sourceid == 5121005) {
localstatups.put(MapleBuffStat.SNATCH, 1);
} else {
localstatups.put(MapleBuffStat.Morph, info.get(MapleStatInfo.x));
}
chr.getClient().getSession().write(BuffPacket.giveBuff(localsourceid, getDuration(), localstatups, this));
chr.registerEffect(this, starttime, BuffTimer.getInstance().schedule(new CancelEffectAction(chr, this, starttime, localstatups), isSubTime(sourceid) ? getSubTime() : getDuration()), localstatups, false, getDuration(), applyfrom.getId());
}
}
示例6: applyEnergyBuff
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public final void applyEnergyBuff(final MapleCharacter applyto, final boolean infinity, int targets) {
final long starttime = System.currentTimeMillis();
if (infinity) {
applyto.getClient().getSession().write(BuffPacket.giveEnergyChargeTest(0, info.get(MapleStatInfo.time) / 1000, targets));
applyto.registerEffect(this, starttime, null, applyto.getId());
} else {
final EnumMap<MapleBuffStat, Integer> stat = new EnumMap<>(MapleBuffStat.class);
stat.put(MapleBuffStat.EnergyCharged, 10000);
applyto.cancelEffect(this, true, -1, stat);
applyto.getMap().broadcastMessage(applyto, BuffPacket.giveEnergyChargeTest(applyto.getId(), 10000, info.get(MapleStatInfo.time) / 1000), false);
final CancelEffectAction cancelAction = new CancelEffectAction(applyto, this, starttime, stat);
final ScheduledFuture<?> schedule = BuffTimer.getInstance().schedule(cancelAction, ((starttime + info.get(MapleStatInfo.time)) - System.currentTimeMillis()));
applyto.registerEffect(this, starttime, schedule, stat, false, info.get(MapleStatInfo.time), applyto.getId());
}
}
示例7: cancelPlayerBuffs
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
private void cancelPlayerBuffs(List<MapleBuffStat> buffstats, boolean overwrite) {
boolean write = client != null && client.getChannelServer() != null && client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null;
if (buffstats.contains(MapleBuffStat.HOMING_BEACON)) {
client.getSession().write(BuffPacket.cancelHoming());
} else {
if (overwrite) {
List<MapleBuffStat> z = new ArrayList<>();
for (MapleBuffStat s : buffstats) {
if (s.canStack()) {
z.add(s);
}
}
if (z.size() > 0) {
buffstats = z;
} else {
return; //don't write anything
}
} else if (write) {
stats.recalcLocalStats(this);
}
client.getSession().write(BuffPacket.cancelBuff(buffstats));
map.broadcastMessage(this, BuffPacket.cancelForeignBuff(getId(), buffstats), false);
}
}
示例8: giveDebuff
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public void giveDebuff(MapleDisease disease, int x, long duration, int skillid, int level) {
if ((this.map != null) && (!hasDisease(disease))) {
if ((disease != MapleDisease.SEDUCE) && (disease != MapleDisease.STUN) && (disease != MapleDisease.FLAG)
&& (getBuffedValue(MapleBuffStat.HOLY_SHIELD) != null)) {
return;
}
int mC = getBuffSource(MapleBuffStat.MECH_CHANGE);
if ((mC > 0) && (mC != 35121005)) {
return;
}
if ((this.stats.ASR > 0) && (Randomizer.nextInt(100) < this.stats.ASR)) {
return;
}
this.diseases.put(disease, new MapleDiseaseValueHolder(disease, System.currentTimeMillis(), duration - this.stats.decreaseDebuff));
this.client.getSession().write(CWvsContext.BuffPacket.giveDebuff(disease, x, skillid, level, (int) duration));
this.map.broadcastMessage(this, CWvsContext.BuffPacket.giveForeignDebuff(this.id, disease, skillid, level, x), false);
if ((x > 0) && (disease == MapleDisease.POISON)) {
addHP((int) (-(x * ((duration - this.stats.decreaseDebuff) / 1000L))));
}
}
}
示例9: handleExtraPVP
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public final void handleExtraPVP(MapleCharacter applyfrom, MapleCharacter chr) {
if (sourceid == 2311005 || sourceid == 5121005 || sourceid == 1201006 || (GameConstants.isBeginnerJob(sourceid / 10000) && sourceid % 10000 == 104)) { //doom, threaten, snatch
final long starttime = System.currentTimeMillis();
final int localsourceid = sourceid == 5121005 ? 90002000 : sourceid;
final Map<MapleBuffStat, Integer> localstatups = new EnumMap<>(MapleBuffStat.class);
if (sourceid == 2311005) {
localstatups.put(MapleBuffStat.MORPH, 7);
} else if (sourceid == 1201006) {
localstatups.put(MapleBuffStat.THREATEN_PVP, (int) level);
} else if (sourceid == 5121005) {
localstatups.put(MapleBuffStat.SNATCH, 1);
} else {
localstatups.put(MapleBuffStat.MORPH, info.get(MapleStatInfo.x));
}
chr.getClient().getSession().write(BuffPacket.giveBuff(localsourceid, getDuration(), localstatups, this));
chr.registerEffect(this, starttime, BuffTimer.getInstance().schedule(new CancelEffectAction(chr, this, starttime, localstatups), isSubTime(sourceid) ? getSubTime() : getDuration()), localstatups, false, getDuration(), applyfrom.getId());
}
}
示例10: applyEnergyBuff
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public final void applyEnergyBuff(final MapleCharacter applyto, final boolean infinity, int targets) {
final long starttime = System.currentTimeMillis();
if (infinity) {
applyto.getClient().getSession().write(BuffPacket.giveEnergyChargeTest(0, info.get(MapleStatInfo.time) / 1000, targets));
applyto.registerEffect(this, starttime, null, applyto.getId());
} else {
final EnumMap<MapleBuffStat, Integer> stat = new EnumMap<>(MapleBuffStat.class);
stat.put(MapleBuffStat.ENERGY_CHARGE, 10000);
applyto.cancelEffect(this, true, -1, stat);
applyto.getMap().broadcastMessage(applyto, BuffPacket.giveEnergyChargeTest(applyto.getId(), 10000, info.get(MapleStatInfo.time) / 1000), false);
final CancelEffectAction cancelAction = new CancelEffectAction(applyto, this, starttime, stat);
final ScheduledFuture<?> schedule = BuffTimer.getInstance().schedule(cancelAction, ((starttime + info.get(MapleStatInfo.time)) - System.currentTimeMillis()));
applyto.registerEffect(this, starttime, schedule, stat, false, info.get(MapleStatInfo.time), applyto.getId());
}
}
示例11: cancelPlayerBuffs
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
private void cancelPlayerBuffs(List<CharacterTemporaryStat> buffstats, boolean overwrite) {
boolean write = client != null && client.getChannelServer() != null && client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null;
if (buffstats.contains(CharacterTemporaryStat.StopForceAtomInfo)) {
client.getSession().write(BuffPacket.cancelHoming());
} else {
if (overwrite) {
List<CharacterTemporaryStat> z = new ArrayList<>();
for (CharacterTemporaryStat s : buffstats) {
// if (s.canStack()) {
// z.add(s);
// }
}
if (z.size() > 0) {
buffstats = z;
} else {
return; //don't write anything
}
} else if (write) {
stats.recalcLocalStats(this);
}
client.getSession().write(BuffPacket.cancelBuff(buffstats));
map.broadcastMessage(this, BuffPacket.cancelForeignBuff(getId(), buffstats), false);
// if (!buffstats.contains(CharacterTemporaryStat.RideVehicle)) {
// map.broadcastMessage(this, CWvsContext.BuffPacket.cancelForeignRiding(getId(), buffstats), false);
// }
}
}
示例12: handleEnergyCharge
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public final void handleEnergyCharge(int skillid, int targets) {
Skill echskill = SkillFactory.getSkill(skillid);
int skilllevel = getTotalSkillLevel(echskill);
if (skilllevel > 0) {
MapleStatEffect echeff = echskill.getEffect(skilllevel);
if (targets > 0) {
if (getBuffedValue(CharacterTemporaryStat.EnergyCharged) == null) {
echeff.applyEnergyBuff(this, true, targets);
} else {
Integer energyLevel = getBuffedValue(CharacterTemporaryStat.EnergyCharged);
if (energyLevel.intValue() < 10000) {
energyLevel = Integer.valueOf(energyLevel.intValue() + echeff.getX() * targets);
this.client.getSession().write(CField.EffectPacket.showOwnBuffEffect(skillid, 2, getLevel(), skilllevel));
this.map.broadcastMessage(this, CField.EffectPacket.showBuffeffect(this.id, skillid, 2, getLevel(), skilllevel), false);
if (energyLevel.intValue() >= 10000) {
energyLevel = Integer.valueOf(10000);
}
this.client.getSession().write(CWvsContext.BuffPacket.giveEnergyChargeTest(energyLevel.intValue(), echeff.getDuration() / 1000));
setBuffedValue(CharacterTemporaryStat.EnergyCharged, Integer.valueOf(energyLevel.intValue()).intValue());
} else if (energyLevel.intValue() == 10000) {
echeff.applyEnergyBuff(this, false, targets);
setBuffedValue(CharacterTemporaryStat.EnergyCharged, Integer.valueOf(10001).intValue());
}
}
}
}
}
示例13: handleOrbconsume
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public void handleOrbconsume(int howmany) {
Skill normalcombo;
switch (getJob()) {
case 1110:
case 1111:
case 1112:
normalcombo = SkillFactory.getSkill(11111001);
break;
default:
normalcombo = SkillFactory.getSkill(1111002);
break;
}
if (getSkillLevel(normalcombo) <= 0) {
return;
}
MapleStatEffect ceffect = getStatForBuff(CharacterTemporaryStat.ComboCounter);
if (ceffect == null) {
return;
}
EnumMap<CharacterTemporaryStat, Integer> stat = new EnumMap<>(CharacterTemporaryStat.class);
stat.put(CharacterTemporaryStat.ComboCounter, Math.max(1, getBuffedValue(CharacterTemporaryStat.ComboCounter) - howmany));
setBuffedValue(CharacterTemporaryStat.ComboCounter, Math.max(1, getBuffedValue(CharacterTemporaryStat.ComboCounter) - howmany));
int duration = ceffect.getDuration();
duration += (int) ((getBuffedStarttime(CharacterTemporaryStat.ComboCounter) - System.currentTimeMillis()));
client.getSession().write(BuffPacket.giveBuff(normalcombo.getId(), duration, stat, ceffect));
map.broadcastMessage(this, BuffPacket.giveForeignBuff(getId(), stat, ceffect), false);
}
示例14: dispelDebuff
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public void dispelDebuff(MapleDisease debuff) {
if (hasDisease(debuff)) {
client.getSession().write(BuffPacket.cancelDebuff(debuff));
map.broadcastMessage(this, BuffPacket.cancelForeignDebuff(id, debuff), false);
diseases.remove(debuff);
}
}
示例15: applyComboBuff
import tools.packet.CWvsContext.BuffPacket; //导入依赖的package包/类
public final void applyComboBuff(MapleCharacter applyto, short combo) {
EnumMap<CharacterTemporaryStat, Integer> stat = new EnumMap<CharacterTemporaryStat, Integer>(CharacterTemporaryStat.class);
stat.put(CharacterTemporaryStat.ComboAbilityBuff, (int) combo);
applyto.getClient().getSession().write(CWvsContext.BuffPacket.giveBuff(this.sourceid, 99999, stat, this));
long starttime = System.currentTimeMillis();
applyto.registerEffect(this, starttime, null, applyto.getId());
}