This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..
Question
janiko
Can anyone help me to fix this error??
[javac] gameserver\model\actor\instance\L2PcInstance.java:16315: error: cannot find symbol
[javac] for (Map.Entry entry : this.ceffects.entrySet())
[javac] ^
[javac] symbol: variable ceffects
[javac] gameserver\model\actor\instance\L2PcInstance.java:16362: error: incompatible types
[javac] for (Map.Entry entry : ceffects.entrySet())
[javac] ^
[javac] required: Entry
[javac] found: Object
[javac] gameserver\model\actor\instance\L2PcInstance.java:16376: error: incompatible types
[javac] for (Map.Entry entry : ceffects.entrySet())
[javac] ^
[javac] required: Entry
[javac] found: Object
[javac] gameserver\model\actor\instance\L2PcInstance.java:16405: error: incompatible types
[javac] for (Map.Entry entry : ceffects.entrySet())
[javac] ^
public void restoreBBSBuf(int forPet) { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("SELECT * FROM character_bbs_buff_save WHERE charId=? AND for_pet=?"); statement.setInt(1, getObjectId()); statement.setInt(2, forPet); ResultSet rset = statement.executeQuery(); while (rset.next()) { int idSkill = rset.getInt("skill_id"); int lvlSkill = rset.getInt("skill_level"); if (forPet == 0) this._bbsBuff.put(Integer.valueOf(idSkill), Integer.valueOf(lvlSkill)); else this._bbsPetBuff.put(Integer.valueOf(idSkill), Integer.valueOf(lvlSkill)); } rset.close(); statement.close(); } catch (Exception e) { _log.log(Level.WARNING, new StringBuilder().append("Could not restore ").append(this).append(" BBS buff data: ").append(e.getMessage()).toString(), e); } finally { L2DatabaseFactory.close(con); } } public void storeBBSBuff(int forPet) { Map ceffects = new FastMap(); if (forPet == 0) ceffects.putAll(this._bbsBuff); else { ceffects.putAll(this._bbsPetBuff); } Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("DELETE FROM character_bbs_buff_save WHERE charId=? AND for_pet=?"); statement.setInt(1, getObjectId()); statement.setInt(2, forPet); statement.execute(); statement.close(); //all i dont know what for now, try continue for (Map.Entry entry : this.ceffects.entrySet()) { statement = con.prepareStatement("INSERT INTO character_bbs_buff_save (charId,skill_id,skill_level,for_pet) VALUES (?,?,?,?)"); statement.setInt(1, getObjectId()); statement.setInt(2, ((Integer)entry.getKey()).intValue()); statement.setInt(3, ((Integer)entry.getValue()).intValue()); statement.setInt(4, forPet); statement.execute(); statement.close(); } } catch (Exception e) { PreparedStatement statement; _log.log(Level.WARNING, "Could not store char effect data: ", e); } finally { L2DatabaseFactory.close(con); } } public void updateBBSBuff(int forPet) { Map ceffects = new FastMap(); L2Character character; if (forPet == 0) character = this; else { character = getPet(); } if (character == null) return; for (L2Effect cureffect : character.getAllEffects()) { int idSklll = cureffect.getId(); int lvlSklll = cureffect.getLevel(); if (BuffBBSTable.getInstance().isBBSSaveBuf(idSklll, lvlSklll)) ceffects.put(Integer.valueOf(idSklll), Integer.valueOf(lvlSklll)); } if (ceffects.isEmpty()) return; if (forPet == 0) { boolean saveBuff = false; if (ceffects.size() != this._bbsBuff.size()) saveBuff = true; for (Map.Entry entry : ceffects.entrySet()) if (!_bbsBuff.containsKey(entry.getKey())) saveBuff = true; if (!saveBuff) { return; } _bbsBuff.clear(); _bbsBuff.putAll(ceffects); } else { boolean saveBuff = false; if (ceffects.size() != this._bbsBuff.size()) saveBuff = true; for (Map.Entry entry : ceffects.entrySet()) if (!this._bbsBuff.containsKey(entry.getKey())) saveBuff = true; if (!saveBuff) { return; } this._bbsPetBuff.clear(); this._bbsPetBuff.putAll(ceffects); } storeBBSBuff(forPet); } public void cactBBSBuff(int forPet) { Map ceffects = new FastMap(); L2Character character; if (forPet == 0) { ceffects.putAll(this._bbsBuff); } else { character = getPet(); ceffects.putAll(this._bbsPetBuff); } if ((character == null) || (ceffects.isEmpty())) { return; } for (Map.Entry entry : ceffects.entrySet()) { L2Skill skill = SkillTable.getInstance().getInfo(((Integer)entry.getKey()).intValue(), ((Integer)entry.getValue()).intValue()); if (skill == null) continue; skill.getEffects(character, character); } } public int calcBBSBuff(int forPet) { Map ceffects = new FastMap(); L2Character character; if (forPet == 0) // pet in invetory { ceffects.putAll(this._bbsBuff); } else { character = getPet(); ceffects.putAll(this._bbsPetBuff); } if ((character == null) || (ceffects.isEmpty())) { return 0; } int result = 0; for (Map.Entry entry : ceffects.entrySet()) { int skillId = ((Integer)entry.getKey()).intValue(); int skillLvl = ((Integer)entry.getValue()).intValue(); int bbsGroup = BuffBBSTable.getInstance().getBBSGroupFotBuf(skillId, skillLvl); if (bbsGroup == 0) continue; int priceGroup = BuffBBSTable.getInstance().getPriceGroup(bbsGroup); if (priceGroup < 0) continue; result += priceGroup; } return result; }7 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now