Witaj
Gość

Wątek: [Pytanie] Item do subklasy  (Przeczytany 1965 razy)

  • Wiadomości: 0

  • Pochwał: 0

[Pytanie] Item do subklasy
« dnia: Czerwiec 01, 2010, 05:04:55 pm »
witam,
chcialbym sie dowiedziec co zrobic zeby do wzieci subklasy u npc, potrzebny byl jakis item
dodam ze wlaczona jest opcja ze nie trzeba miec questa na mimir's elixir
chce zeby byl potrzebny tylko jeden item do wziecia suby, bedzie do tego potrzebny nowy quest w pythonie?


  • Wiadomości: 0

  • Pochwał: 0

Odp: [Pytanie] Item do subklasy
« Odpowiedź #1 dnia: Czerwiec 09, 2010, 04:09:29 am »
tylu "szpeców" i nikt nie może pomóc? no trudno, poszukam pomocy gdzie indziej.


  • Wiadomości: 643

  • Pochwał: 10

  • L2Cerberus/L2DC developer
    • L2Cerberus
Odp: [Pytanie] Item do subklasy
« Odpowiedź #2 dnia: Czerwiec 09, 2010, 08:16:37 am »
W metodzie haveSubItem dodałem komentarz gdzie masz podać id itemu który jest wymagany.

Index: java/com/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java
===================================================================
--- java/com/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java (revision 4388)
+++ java/com/l2j/gameserver/model/actor/instance/L2VillageMasterInstance.java (working copy)
@@ -18,6 +18,7 @@
 import com.l2j.Config;
 import com.l2j.gameserver.datatables.CharTemplateTable;
 import com.l2j.gameserver.datatables.SkillTreeTable;
+import com.l2j.gameserver.model.L2ItemInstance;
 import com.l2j.gameserver.model.L2PledgeSkillLearn;
 import com.l2j.gameserver.model.base.ClassId;
 import com.l2j.gameserver.model.base.ClassType;
@@ -289,7 +290,7 @@
  * If they both exist, remove both unique items and continue with adding the
  * sub-class.
  */
- if (allowAddition && !Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS)
+ if (allowAddition && (!Config.ALT_GAME_SUBCLASS_WITHOUT_QUESTS && haveSubItem(player)))
  allowAddition = (checkQuests(player) || player.getIsSubclassAllowed());
 
  if (allowAddition && isValidNewSubClass(player, paramOne, false))
@@ -612,6 +613,17 @@
 
  return Race.Kamael;
  }
+
+ public boolean haveSubItem(L2PcInstance player)
+ {
+ L2ItemInstance[] inventory = player.getInventory().getItems();
+ for (L2ItemInstance i : inventory)
+ {
+ if (i.getItemId() == 57) // tutaj ustaw sobie wymagany item
+ return true;
+ }
+ return false;
+ }
 
  public final ClassType getVillageMasterTeachType()
  {
I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features.
Let's Kick Python Out of L2J.



  • Wiadomości: 0

  • Pochwał: 0

Odp: [Pytanie] Item do subklasy
« Odpowiedź #3 dnia: Czerwiec 09, 2010, 12:25:02 pm »
dzieki bardzo :)


  • Wiadomości: 643

  • Pochwał: 10

  • L2Cerberus/L2DC developer
    • L2Cerberus
Odp: [Pytanie] Item do subklasy
« Odpowiedź #4 dnia: Czerwiec 09, 2010, 07:41:46 pm »
nie ma problemu :)
I would love to change the world, but they won't give me the source code.
My software never has bugs. It just develops random features.
Let's Kick Python Out of L2J.