Jump to content

GameBlonD

Members
  • Posts

    553
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by GameBlonD

  1. I found the issue tnx for your help (the code was working only for instance =0 i fixed it.
  2. yes i have fixed in L2monsterinstance and works fine outside but inside instance not
  3. Hi, It is possible to make mobs returning to spawn on INSTANCES too? Any ideas? example of code? Thanks.
  4. Hi, I have a problem with over-hit Only the first player that hits the mob can Over-hit a mob (when they are in party) Where should i look to fix that? Thanks.
  5. this is the load method: // This method loads castle door data from database private void loadDoor() { Connection con = null; try { con = L2DatabaseFactory.getInstance().getConnection(); PreparedStatement statement = con.prepareStatement("Select * from castle_door where castleId = ?"); statement.setInt(1, getCastleId()); ResultSet rs = statement.executeQuery(); while (rs.next()) { // Create list of the door default for use when respawning dead doors _doorDefault.add(rs.getString("name") + ";" + rs.getInt("id") + ";" + rs.getInt("x") + ";" + rs.getInt("y") + ";" + rs.getInt("z") + ";" + rs.getInt("range_xmin") + ";" + rs.getInt("range_ymin") + ";" + rs.getInt("range_zmin") + ";" + rs.getInt("range_xmax") + ";" + rs.getInt("range_ymax") + ";" + rs.getInt("range_zmax") + ";" + rs.getInt("hp") + ";" + rs.getInt("pDef") + ";" + rs.getInt("mDef")); L2DoorInstance door = DoorTable.parseList(_doorDefault.get(_doorDefault.size() - 1), false); _doors.add(door); DoorTable.getInstance().putDoor(door); } ResourceUtil.closeResultSet(rs); ResourceUtil.closeStatement(statement); } catch (Exception e) { _log.log(Level.WARNING, "Exception: loadCastleDoor()", e); } finally { ResourceUtil.closeConnection(con); } } This the spawn method (when i kill doors /start /end siege then works so i am guessing this is the code that works fine: /** * Respawn all doors on castle grounds<BR> * <BR> */ public void spawnDoor(boolean isDoorWeak) { for (int i = 0; i < getDoors().size(); i++) { L2DoorInstance door = getDoors().get(i); if (door.getCurrentHp() <= 0) { door.decayMe(); // Kill current if not killed already door = DoorTable.parseList(_doorDefault.get(i), false); DoorTable.getInstance().putDoor(door); // Readd the new door to the DoorTable By Erb if (isDoorWeak) door.setCurrentHp(door.getMaxHp() / 2); door.spawnMe(door.getX(), door.getY(), door.getZ()); getDoors().set(i, door); } else if (door.getOpen()) door.closeMe(); } loadDoorUpgrade(); // Check for any upgrade the doors may have } How to adjust it so castle doors to work in server start?
  6. Players can hit through doors (in castle for example) But if i start siege Kill Doors/end siege then doors working good no more exploits etc I tried to load DoorTable.getInstance(); before/after geodata but with no result.. What else can cause this?
  7. Ok it doesn't work in latest revision of l2j also i found the issue causing this you can lock it , thanks.
  8. So i checked l2j last revisions and they use the same code... i dont know if this bug happens and inside the game maybe i test it later. So the problem is here: if (getCurrentMp() < getStat().getMpConsume(skill) + getStat().getMpInitialConsume(skill) && !isAttackingNow()) I added !isAttackingNow and now it does ->one skill - auto attack player dead but he does skill with 0 mp :P I will try to improve it somehow if some1 has a way let me know.
  9. int saMpConsume = (int) getStat().calcStat(Stats.MP_CONSUME, 0, null, null); int mpConsume = saMpConsume == 0 ? weaponItem.getMpConsume() : saMpConsume; mpConsume = (int) calcStat(Stats.BOW_MP_CONSUME_RATE, mpConsume, null, null);
  10. Yes if players has mp and spam skills = auto attack works fine the problem is when he doesn't have mp
  11. Maybe this happen because client spam failed packets?
  12. if (getCurrentMp() < mpConsume) { // If L2PcInstance doesn't have enough MP, stop the attack ThreadPoolManager.getInstance().scheduleAi(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000); sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_MP)); sendPacket(ActionFailed.STATIC_PACKET); return; } // Check if the caster has enough MP if (getCurrentMp() < getStat().getMpConsume(skill) + getStat().getMpInitialConsume(skill)) { // Send a System Message to the caster sendPacket(new SystemMessage(SystemMessageId.NOT_ENOUGH_MP)); // Send a Server->Client packet ActionFailed to the L2PcInstance sendPacket(ActionFailed.STATIC_PACKET); return false; } This two are the only one that displays Not Enough mp what should i change?
  13. He tries to cast the Skill but get message Not Enough Mp(because he doesnt have MP) so he spam The skill deadly blow and also tries to hit with simple hits the result= simple hits doesn't even have system messages nothing only consumption of ss.
  14. hi , The problem is when a player spam Deadly blow(for example) and get the message Not Enough MP and together spam Attack the result is NO damage no message nothing the only message is : Not Enough MP
  15. change isSubClassActive with?
  16. public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) { L2PcInstance partyMember = getRandomPartyMember(player, "1"); if (partyMember == null) return null; QuestState st = partyMember.getQuestState(getName()); if (st == null) return null; int id = npc.getNpcId(); int cond = st.getInt("cond"); switch (cond) { case 1: if (id == MOB1 && st.getQuestItemsCount(QITEM1) == 0) { st.giveItems(QITEM1,1); if (st.getQuestItemsCount(QITEM1) >= 1 && st.getQuestItemsCount(QITEM2) >= 1) { st.set("cond","2"); st.playSound("ItemSound.quest_middle"); } Is this possibly to give into whole party? dont mind about }{
  17. I fixed for now but something blocking pet_max_experience , One question when pet goes 86 lvl = max lvl when i kill a mob pet doesnt take any xp only owner(takes full XP like without pet) is this normal if a pet is max level?
  18. And what should i change for pets? I need sin eater to go lvl 86 With temp fix at least
  19. Yes but when i do this changes pets level up to 86 lvl but players also What i should add so only pets can level up?
  20. I am trying to make pets go up to 86 lvl in old gracia pack, What i change: red= what i add/change Experience.java: 11844000000L, // level 83 15472800000L, // level 84 25314105600L, //level 86 32211728640L }; //level 87 public final static byte MAX_LEVEL = 86; public final static byte PET_MAX_LEVEL = 87; ------------------------------------------------------------------ Petstat.java: public final boolean addLevel(byte value) { if (getLevel() + value > (Experience.PET_MAX_LEVEL - 1)) return false; ------------------------------------------------------------------- PlayableStat.java public boolean addExp(long value) { if ((getExp() + value) < 0 || (value > 0 && getExp() == (getExpForLevel(Experience.PET_MAX_LEVEL) - 1))) return true; if (getExp() + value >= getExpForLevel(Experience.PET_MAX_LEVEL)) value = getExpForLevel(Experience.PET_MAX_LEVEL) - 1 - getExp(); setExp(getExp() + value); byte minimumLevel = 1; if (getActiveChar() instanceof L2PetInstance) { // get minimum level from L2NpcTemplate minimumLevel = ((L2PetInstance) getActiveChar()).getTemplate().level; } byte level = minimumLevel; // minimum level for (byte tmp = level; tmp <= Experience.PET_MAX_LEVEL; tmp++) { if (getExp() >= getExpForLevel(tmp)) continue; level = --tmp; break; } if (level != getLevel() && level >= minimumLevel) addLevel((byte) (level - getLevel())); return true; } public boolean removeExp(long value) { if ((getExp() - value) < 0) value = getExp() - 1; setExp(getExp() - value); byte minimumLevel = 1; if (getActiveChar() instanceof L2PetInstance) { // get minimum level from L2NpcTemplate minimumLevel = ((L2PetInstance) getActiveChar()).getTemplate().level; } byte level = minimumLevel; for (byte tmp = level; tmp <= Experience.PET_MAX_LEVEL; tmp++) { if (getExp() >= getExpForLevel(tmp)) continue; level = --tmp; break; } if (level != getLevel() && level >= minimumLevel) addLevel((byte) (level - getLevel())); return true; } public boolean addLevel(byte value) { if (getLevel() + value > Experience.PET_MAX_LEVEL - 1) { if (getLevel() < Experience.PET_MAX_LEVEL - 1) value = (byte) (Experience.PET_MAX_LEVEL - 1 - getLevel()); else return false; } boolean levelIncreased = (getLevel() + value > getLevel()); value += getLevel(); setLevel(value); // Sync up exp with current level if (getExp() >= getExpForLevel(getLevel() + 1) || getExpForLevel(getLevel()) > getExp()) setExp(getExpForLevel(getLevel())); if (!levelIncreased) return false; getActiveChar().getStatus().setCurrentHp(getActiveChar().getStat().getMaxHp()); getActiveChar().getStatus().setCurrentMp(getActiveChar().getStat().getMaxMp()); if (getActiveChar() instanceof L2PcInstance) CommunityServerThread.getInstance().sendPacket(new WorldInfo((L2PcInstance) getActiveChar(), null, WorldInfo.TYPE_UPDATE_PLAYER_DATA)); return true; } The problem is after the playableStat.java changes pets can leven up up to 86 lvl but Players can too Any ideas what to change in order to PET_MAX_LEVEL apply only to pets?
  21. The problem is when i use this: String name = activeChar.getName(); activeChar.sendPacket(new CreatureSay(0, Say2.PARTY, name, "System: Skill Enabled")); Players get message PLAYERNAME: System: Skill Enabled I am trying to make it System: Skill enabled with creaturesay because i need it in the chat :P
  22. in add skill ,false=? what false does? Also I want to add some additions I tried to send the message in party chat but with this code the message goes String name = activeChar.getName(); activeChar.sendPacket(new CreatureSay(0, Say2.PARTY, name, "Skill Enabled")); Player name: Skill Enabled How it can be like this: System: Skill Enabled
  23. Thanks dude that was excactly what i wanted! One Question in add skill ,false=? what false does?
  24. Kanw mia dokimh me ayto ala den kserw pos na to kano to !=null na diabazei oti ean uparxei 1 tetio item sto inventory if (activeChar.getInventory().getItemByItemId(9819) != null) { L2Skill skill = SkillTable.getInstance().getInfo(294, 1); if (skill != null && activeChar.getSkillLevel(294) == 1) { if (GameTimeController.getInstance().isNowNight()) { SystemMessage sm = new SystemMessage(SystemMessageId.NIGHT_EFFECT_S1_APPLIES); sm.addSkillName(294); sendPacket(sm); } else { SystemMessage sm = new SystemMessage(SystemMessageId.DAY_EFFECT_S1_DISAPPEARS); sm.addSkillName(294); sendPacket(sm); } } }
×
×
  • Create New...