Jump to content
  • 0

Help With Item


Question

Posted (edited)

Hello guys i made a item

l3zPblQ.png



i want  to make it when some one double click on it to give 500 reputation points to his clan

how can i do that ? i have no idea really! help me out please ! thanks!


and something else, im searching for A Sub class master npc in which you can choose any subclass available. but i cant find any

you know all these npcs in one

8cUDsNe.png


can i make one? how?  i use l2jfrozen


thanks for your time

Edited by Stev0

15 answers to this question

Recommended Posts

  • 0
Posted (edited)

So, just make 2 new configs like

REQUIRED_ITEM = your id
REQUIRED_AMOUNT = 5000

and replace them in the code here

if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel() >= 5 and st.getPlayer().getClan().getReputationScore() < NEW_REP_SCORE :
if st.getPlayer().isNoble() and count > REQUESTED_AMOUNT:
htmltext=event
st.getPlayer().getClan().setReputationScore(NEW_REP_SCORE, 5000);
st.playSound("ItemSound.quest_finish")
st.takeItems(REQUESTED_ITEM,REQUESTED_AMOUNT)

REQUESTED_TEM / REQUESTED_AMOUNT => REQUIRED_ITEM / REQUIRED_AMOUNT

 

 

Should work :P

Edited by SweeTs
  • 0
Posted (edited)

Depend what pack he use. There may be not such config. Anyway.

 

About clan rep item. You have to create new item handler

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.itemhandlers;

import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.L2Playable;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;

public class ClanItem implements IItemHandler
{
    @Override
    public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
    {
        if (!(playable instanceof L2PcInstance))
            return;
        
        final L2PcInstance activeChar = (L2PcInstance) playable;
        
        if (activeChar.getClan() == null)
            return;
        
        if (!activeChar.isClanLeader())
        {
            activeChar.sendMessage("Only clan leader can use it.");
            return;
        }
        
        activeChar.getClan().addReputationScore(500);
        activeChar.getClan().broadcastClanStatus();
        activeChar.sendMessage("Your clans reputation score has been increased.");
        MagicSkillUse MSU = new MagicSkillUse(activeChar, activeChar, 2024, 1, 1, 0);
        activeChar.broadcastPacket(MSU);
        activeChar.destroyItem("Consume", item.getObjectId(), 1, null, true);
    }
}

Then register it inside Itemhandler.java

 

Go to xml folder, to the item that you want and change its handler to ClanItem.

Edited by SweeTs
  • 0
Posted

i use l2jfrozen


and sweets how do i make a new item handler? im a newbie so i dont really understand the items i show on the pic its called "lord of the manor's certificate"(id 5708) something like that i just changed its name and description (about eclipse i dont know anything)

  • 0
Posted

So, use frozen forum. There is a patch @ frozen forum for sure. Also, Im award it's not implemented in sources, or maybe it is, dunno rly.

 

You must add new file at eclipse, gameserver.handler.itemhandlers; in here, you have create it.

  • 0
Posted

oh dude im not good with java ...

is it possible to make a npc which will give clan reputation points in exchange for some items like gold bars or something?

i have a clan manager in my pack but it only lvls up the clan to lvl 8
 

you know without using eclipse


any ideas?

  • 0
Posted (edited)

so im using a clan manager from a different pack and this npc can lvl up the clan and give clan reputations :-beep- yeah:

but i want to change this> when i want to lvl up the clan the requirements are 5k fire mantra
and when i want to get reputation the requirements are again 5k fire mantra     

so i want to change the requirements for clan reputation to be 2k water mantra if possible
it uses the same item ID for both things..

heres the code:
 

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
from java.util import Iterator
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

qn = "6667_ClanManager"

NPC=[66667]
REQUESTED_ITEM=5574
REQUESTED_AMOUNT=5000
NEW_REP_SCORE=5000
QuestId     = 6667
QuestName   = "ClanManager"
QuestDesc   = "custom"
InitialHtml = "66667-1.htm"

print "Clan Manager (66667) Enabled..."

class Quest (JQuest) :

	def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

	def onEvent(self,event,st):
               htmltext = "<html><head><body>I have nothing to say you</body></html>"
               count=st.getQuestItemsCount(REQUESTED_ITEM)
               if event == "66667-clanOk.htm" :
                   if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel()<8:
                       if st.getPlayer().isNoble() and count >= REQUESTED_AMOUNT:
                            htmltext=event
                            st.getPlayer().getClan().changeLevel(8)
                            st.playSound("ItemSound.quest_finish")
                            st.takeItems(REQUESTED_ITEM,REQUESTED_AMOUNT)
                       else :
                            htmltext="66667-no_clan.htm"
                            st.exitQuest(1)
                   else :
                       htmltext="66667-no_clan.htm"
                       st.exitQuest(1)
               elif event == "66667-repOk.htm" :
                   if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel() >= 5 and st.getPlayer().getClan().getReputationScore() < NEW_REP_SCORE :
                       if st.getPlayer().isNoble() and count > REQUESTED_AMOUNT:
                            htmltext=event
                            st.getPlayer().getClan().setReputationScore(NEW_REP_SCORE, 5000);
                            st.playSound("ItemSound.quest_finish")
                            st.takeItems(REQUESTED_ITEM,REQUESTED_AMOUNT)
                       else :
                            htmltext="66667-no_points.htm"
                            st.exitQuest(1)
                   else :
                       htmltext="66667-no_points.htm"
                       st.exitQuest(1)
               return htmltext

	def onTalk (self,npc,player):
	   htmltext = "<html><head><body>I have nothing to say you</body></html>"
           st = player.getQuestState(qn)
           if not st : return htmltext
           npcId = npc.getNpcId()
           id = st.getState()
           if id == CREATED :
               htmltext="66667-1.htm"
           elif id == COMPLETED :
               htmltext = "<html><head><body>This quest have already been completed.</body></html>"
           else :
               st.exitQuest(1)
           return htmltext


QUEST = Quest(6667,qn,"custom")
CREATED     = State('Start', QUEST)
STARTING    = State('Starting', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)
QUEST.setInitialState(CREATED)

for npcId in NPC:
 QUEST.addStartNpc(npcId)
 QUEST.addTalkId(npcId)

please some1 help i need to fix this Thanks! :alone:

Edited by Stev0
  • 0
Posted (edited)

You already changed it

REQUESTED_ITEM=5574
REQUESTED_AMOUNT=5000

I don't get your problem :o

 

Btw, when you restart the server your clan lvl stay or get back to previous level or to 0 ?

 

Since..

st.getPlayer().getClan().changeLevel(8)

Should be setLevel and not change.. Anyway, that's broken pack, so everything is possible :happyforever:

 

 

Also, haha this code is funny :happyforever: :happyforever:

Edited by SweeTs
  • 0
Posted (edited)

nope the clan stays at lvl 8.
 

what i mean is that ,  this> "REQUESTED_ITEM=5574" its used for lvl up and rep points.  i want to change the clan rep to another id, or the lvl up to another item id so it doesnt take the same amount of the same item

when i want to lvl up the clan to take gold bars and when i want to get rep point to take ancient adena (i dont knwo how else to describe it)

first button lvl up clan = gold bars
second button rep points = ancient adena

sorry for my english (im still learning) :forever alone like a boss:

Edited by Stev0
  • 0
Posted

You say that you are not good with java.. but he already provided you with the code.. so what's the problem here? Just import it in your source and you'll be fine, it's really just 1 min job.

  • 0
Posted

clan manager fixed

now about the other thing the Sub class master npc in which you can choose any subclass available

how to make one ? or is there any a can download? (no luck with this npc cant be found)

Guest
This topic is now closed to further replies.


  • Posts

    • 🔥 Launch was a success! Over 500 players joined L2Elixir on opening day, and we are holding a steady 420–450 online! We faced extortion attempts and heavy DDoS attacks, but our protections held strong — even if the cost was far higher than expected. What matters is we fought back and kept the server online for you. ⚔️ 💙 Our priority is simple: Deliver a stable, fair, and growing server that will evolve for years to come. We continue to invest in protections, advertising, and development — and we won’t stop. All we ask from YOU is one thing: 👉 Keep playing. The more active the community is, the faster the server grows. 💠 Important Note: We have no paid clans or CPs, no “boosted” groups, no unfair benefits. Everyone has an equal chance to progress and compete. Thank you to everyone who joined, supported, and believed in this project. Let’s make L2Elixir great again — even in 2025–2026! 🚀   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • https://jumpshare.com/share/kIdeKALOhgtMKpBKqxpg Test Equip Armors-> FullPlate, Gloves, Legs, Chest , Boots
    • 黑色星期五 — 为您的流量提供高级福利 仅在11月28日,我们的特别促销码可为您提供13%的商店折扣。 促销码: BLACKFRIDAY (13% 折扣) 您可以通过我们的网站或 Telegram 机器人在商店购物! 有效链接: 数字商品商店(网站): 前往 商店 Telegram 机器人: 前往 – 通过 Telegram Messenger 方便访问商店。 其他服务: 虚拟号码服务: 前往 用于购买 Telegram Stars 的机器人: 前往 – 快速且优惠地在 Telegram 中购买 Stars。 SMM 面板: 前往 – 推广您的社交媒体账户。 我们向您呈现当前的 促销和特惠活动 列表,用于购买我们服务的产品和服务: 1. 您可以在首次购买时使用促销码:SOCNET(15% 折扣) 2. 获取 $1 商店余额或 10–20% 折扣 — 只需在我们网站注册后发送您的用户名,格式如下:“SEND ME BONUS, MY USERNAME IS...” — 您需要在我们的论坛帖子中写下这句话! 3. SMM 面板首次试用可获得 $1:只需在我们的网站(支持)提交主题为“Get Trial Bonus”的工单。 4. 我们的 Telegram 频道和 Stars 购买机器人每周都会举办 Telegram Stars 抽奖活动! 新闻: ➡ Telegram 频道: https://t.me/accsforyou_shop ➡ WhatsApp 频道: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord 服务器: https://discord.gg/y9AStFFsrh 联系方式与支持: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ 邮箱: solomonbog@socnet.store
    • BLACK FRIDAY — PREMIUM BENEFITS FOR YOUR TRAFFIC Only on November 28 our special promo code gives you a 13% discount in the store. PROMO CODE: BLACKFRIDAY (13% Discount) Shop in our store on the website or via the Telegram bot! Active links: Digital goods store (Website): Go Store Telegram bot: Go – convenient access to the store via Telegram messenger. Other services: Virtual numbers service: Go Telegram bot for purchasing Telegram Stars: Go – fast and profitable purchase of stars in Telegram. SMM Panel: Go – promotion of your social media accounts. We want to present you the current list of promotions and special offers for purchasing our service's products and services: 1. You can use a promo code for your first purchase: SOCNET (15% discount) 2. Get $1 to your store balance or a 10–20% discount — just send your username after registering on our website using the following template: "SEND ME BONUS, MY USERNAME IS..." — you need to write this in our forum thread! 3. Get $1 for the first trial start of the SMM Panel: just open a ticket with the subject "Get Trial Bonus" on our website (Support). 4. Weekly Telegram Stars giveaways in our Telegram channel and in our bot for purchasing stars! News: ➡ Telegram channel: https://t.me/accsforyou_shop ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t ➡ Discord server: https://discord.gg/y9AStFFsrh Contacts and Support: ➡ Telegram: https://t.me/socnet_support ➡ WhatsApp: https://wa.me/79051904467 ➡ Discord: socnet_support ➡ ✉ Email: solomonbog@socnet.store
    • Usually, I work alone on my projects, but sometimes the work is much more than I've expected. Could you provide a price list? It would be good if we knew your price before contacting you. 
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock