[Pytanie] Item do subklasy

Zaczęty przez CrAzYzIoM, Czerwiec 01, 2010, 05:04:55 PM

Poprzedni wątek - Następny wątek

CrAzYzIoM

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?

CrAzYzIoM

tylu "szpeców" i nikt nie może pomóc? no trudno, poszukam pomocy gdzie indziej.

InsOmnia-

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.


CrAzYzIoM


InsOmnia-

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.