- UID
- 72773
- 閱讀權限
- 20
- 主題
- 13
- 帖子
- 69
- 精華
- 5
- A幣
- 216
- 在線時間
- 163 小時
- 最後登錄
- 2024-11-22
初窺門道
- 主題
- 13
- 帖子
- 69
- 精華
- 5
- 綜合社群主題發文量
- 0
- 電玩社群主題發文量
- 0
- 娛樂社群主題發文量
- 0
- 技術社群主題發文量
- 13
- 閱讀權限
- 20
- 註冊時間
- 2019-8-9
TA的每日心情 | 衰 2021-6-8 20:12 |
---|
簽到天數: 14 天 連續簽到: 0 天 [LV.3]偶爾看看II
|
本帖最後由 a894985459 於 2023-5-18 23:16 編輯
嗨 又是我
最近跟朋友提到相關Bug 順手看了一下 就順便修復了
問題點:里波會幾乎永久存在、甦醒buff不會消失 存在右上角持續閃爍
各端口存在問題不見得一樣
分段教學
1.里波存在時間
2.甦醒buff不會消失 存在右上角持續閃爍
老樣子 打開你的IDE
找到MapleSummon.java
先宣告
往下隨意一處增加
- public long getSpawnTime(){
- return SpawnTime;
- }
-
- public void setSpawnTime(long now){
- SpawnTime=now;
- }
複製代碼
轉到MapleCharacter.java先宣告
- private Map<Integer, MapleSummon> summons2 = new LinkedHashMap<Integer, MapleSummon>();
複製代碼
在來隨意一處增加
- public Map<Integer, MapleSummon> getSummons() {
- return Collections.synchronizedMap(summons2);
- }
複製代碼
搜尋
- if (stat == MapleBuffStat.SUMMON || stat == MapleBuffStat.PUPPET ||
複製代碼 內容大概會是這樣
- if (stat == MapleBuffStat.SUMMON || stat == MapleBuffStat.PUPPET || stat == MapleBuffStat.REAPER || stat == MapleBuffStat.BEHOLDER || stat == MapleBuffStat.DAMAGE_BUFF || stat == MapleBuffStat.RAINING_MINES || stat == MapleBuffStat.ANGEL_ATK) {
- final int summonId = mbsvh.effect.getSourceId();
- final List<MapleSummon> toRemove = new ArrayList<MapleSummon>();
- 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 == MapleBuffStat.RAINING_MINES && summonId == 33101008) || (summonId == 35121009 && summon.getSkill() == 35121011) || ((summonId == 86 || summonId == 88 || summonId == 91) && summon.getSkill() == summonId + 999) || ((summonId == 1085 || summonId == 1087 || summonId == 1090 || summonId == 1179) && summon.getSkill() == summonId - 999)) { //removes bots n tots
- map.broadcastMessage(SummonPacket.removeSummon(summon, true));
- map.removeMapObject(summon);
- visibleMapObjects.remove(summon);
- toRemove.add(summon);
- }
複製代碼
在
- summonsLock.writeLock().lock();
複製代碼 下方增加
- int ReaperTime = 10000 + (2 * ((getSkillLevel(32111006) / 2) * 1000));
複製代碼
在括弧下方增加
- if(summon.isReaper() && (System.currentTimeMillis()-summon.getSpawnTime()) >= ReaperTime){
- map.broadcastMessage(SummonPacket.removeSummon(summon, true));
- map.removeMapObject(summon);
- visibleMapObjects.remove(summon);
- toRemove.add(summon);
- }
複製代碼 P.S.注意括弧位置
轉到
SummonHandler.java
搜尋
- public static final void DamageSummon
複製代碼 內容大概會是
- 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();
複製代碼
宣告處一樣增加
- int ReaperTime = 10000 + (2 * ((chr.getSkillLevel(32111006) / 2) * 1000));
複製代碼 往下
在
- try {
- while (iter.hasNext()) {
- summon = iter.next();
複製代碼 之下增加
- if(summon.isReaper() && (System.currentTimeMillis()-summon.getSpawnTime()) >= ReaperTime){
- chr.getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
- chr.getMap().removeMapObject(summon);
- chr.removeSummon(summon);
- }
複製代碼 在往下搜尋
- if (!summon.isMultiAttack()) {
複製代碼 在整段結尾後增加
- int ReaperTime = 10000 + (2 * ((chr.getSkillLevel(32111006) / 2) * 1000));
- if(summon.isReaper() && (System.currentTimeMillis()-summon.getSpawnTime()) >= ReaperTime){
- chr.getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
- chr.getMap().removeMapObject(summon);
- chr.removeSummon(summon);
- }
複製代碼 往下搜尋
- public static final void SubSummon
複製代碼 內容大概會是
- 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;
- }
複製代碼 在這之下增加
- int ReaperTime = 10000 + (2 * ((chr.getSkillLevel(32111006) / 2) * 1000));
- if(sum.isReaper() && (System.currentTimeMillis()-sum.getSpawnTime()) >= ReaperTime){
- chr.getMap().broadcastMessage(SummonPacket.removeSummon(sum, true));
- chr.getMap().removeMapObject(sum);
- chr.removeSummon(sum);
- }
複製代碼
最後找到內容大概類似下方
- if (didAttack) {
- chr.getMap().broadcastMessage(SummonPacket.pvpSummonAttack(chr.getId(), chr.getLevel(), summon.getObjectId(), summon.isFacingLeft() ? 4 : 0x84, summon.getTruePosition(), ourAttacks));
- if (!summon.isMultiAttack()) {
- chr.getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
- chr.getMap().removeMapObject(summon);
- chr.removeVisibleMapObject(summon);
- chr.removeSummon(summon);
- if (summon.getSkill() != 35121011) {
- chr.cancelEffectFromBuffStat(MapleBuffStat.SUMMON);
- }
- }
- }
複製代碼 在這下方增加
- int ReaperTime = 10000 + (2 * ((chr.getSkillLevel(32111006) / 2) * 1000));
- if(summon.isReaper() && (System.currentTimeMillis()-summon.getSpawnTime()) >= ReaperTime){
- chr.getMap().broadcastMessage(SummonPacket.removeSummon(summon, true));
- chr.getMap().removeMapObject(summon);
- chr.removeSummon(summon);
- }
複製代碼
至此 里波已經可以用正常的時間存在與消失
如果有缺少語法
請到MapleSummon.java
隨意一處增加
- public final boolean isReaper() {
- return skill == 32111006;
- }
複製代碼
轉到MapleMap.java
找到類似內容
- for (final MapleCharacter mc : characters) {
- if (mc.isAlive()) {
- buff.applyTo(mc);
- switch (monster.getId()) {
- case 8810018:
- case 8810122:
- case 8820001:
- mc.getClient().getSession().write(EffectPacket.showOwnBuffEffect(buffid, 13, mc.getLevel(), 1)); // HT nine spirit
- broadcastMessage(mc, EffectPacket.showBuffeffect(mc.getId(), buffid, 13, mc.getLevel(), 1), false); // HT nine spirit
- break;
- }
- }
- }
- } finally {
- charactersLock.readLock().unlock();
- }
- }
- ...
- ...
- ...
- ...
- final int mobid = monster.getId();
- ExpeditionType type = null;
- if (mobid == 8810018 && mapid == 240060200) { // Horntail
複製代碼 在上方括弧後增加
- if (chr.getBuffedValue(MapleBuffStat.REAPER) != null) {
- Skill reaper = SkillFactory.getSkill(32111006);
- if (reaper.getEffect(chr.getSkillLevel(reaper)).makeChanceResult()) {
- MapleSummon summon = chr.getSummons().get(32111006);
- if (summon == null) {
- summon = new MapleSummon(chr, 32111006, chr.getSkillLevel(reaper), chr.getPosition(), SummonMovementType.WALK_STATIONARY);
- summon.setSpawnTime(System.currentTimeMillis());
- chr.addSummon(summon);
- }
- chr.getMap().spawnSummon(summon);
- }
- }
複製代碼
完成後大概會是這樣
- } finally {
- charactersLock.readLock().unlock();
- }
- }
- 加入的語法
- final int mobid = monster.getId();
- ExpeditionType type = null;
- if (mobid == 8810018 && mapid == 240060200) { // Horntail
複製代碼
來講講第二部分 buff會一直存在的問題
修復點也很簡單
找到MapleStatEffect.java
往下搜尋
- } else if (sourceid == 32111006) {
複製代碼 內容大概會是
- if (isBeholder()) {
- tosummon.addHP((short) 1);
- } else if (sourceid == 4341006) {
- applyfrom.cancelEffectFromBuffStat(MapleBuffStat.SHADOWPARTNER);
- } else if (sourceid == 32111006) {
- applyfrom.cancelEffectFromBuffStat(MapleBuffStat.REAPER);
- return true; //no buff
- } else if (sourceid == 35111002) {
複製代碼 問題點很簡單
把
註釋掉或是刪掉就可以了
編譯 至此又修復了一個技能
若還有缺少任何涵式請告知
|
|