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

    • New release   World & atmosphere   - Grass is back — terrain grass now grows across the world like the original client, with settings for on / original-style / off, two sway styles, and optional grass shadows.   - Day/night and the sky now follow the game server, including sunrise, sunset, Seven Signs skies, and red-sky events. A manual override remains available in settings.   - Doors are now live — castle and town doors open and close according to the server, can be targeted, and display their health.   - Earthquake events now shake the screen and play their original rumble sounds.    Map & navigation   - New live minimap — an always-on radar with a rotating player arrow, party, target and NPC markers, zone labels, hover tooltips, three zoom levels, and collapse and resize controls. Clicking it opens the full world map.   - Zone titles now fade onto the screen when you enter a new region.   - The world map now displays your current zone name and party-member positions.   Combat & effects   - Enchanted weapons now glow properly, complete with drifting wisps, across every weapon type — including on the character selection screen.   - Soulshot, Spiritshot, Fishing Shot, and Beast Shot activations now play their original flashes and sounds. A new “hide shot effects” option is available if you prefer not to see them.   - Item-use visuals have been restored — potions, antidotes, echo crystals, fireworks, and other usable items now play their proper effects.   - Skill damage now displays floating damage numbers, and critical skill hits shake the camera.   - New buff bar — active buffs, debuffs, and toggles now appear as icons above the HUD.   - Bow skills now nock and release their arrows at the correct animation moments.   Shops & items   - NPC shops now work — a complete buy window with prices, weight and Adena totals, stock limits, and a quantity dialog for stackable items.   - Player-to-player trading now works, including timed trade requests, complete inventory and offer panes, quantity selection for stackable items, weight preview, confirmation locking, cancellation, and trade completion.   - Item enchanting now works — using an enchant scroll opens the original-style item selection window with enchant levels and full item tooltips, plus proper selection and cancellation handling.   - Item cooldowns, including potions and similar items, now appear on the shortcut bar.   - Item tooltips and the inventory window have received further polish.   - Weapon tooltips now correctly identify weapon classes and calculate enchant-adjusted P. Atk. values for bows, two-handed weapons, fists, and dual swords.   Chat & commands   - Slash commands now work, including /time, /loc, and other server commands. GM accounts can also use // admin commands.   - Action commands can now be entered directly in chat, including sit/stand, walk/run, normal and forced attacks, trade, target next, pickup, assist, party actions, social emotes, and duels.   - System messages can optionally be separated into their own window, and the chat font size is adjustable.   - Server event announcements now appear on screen as they did in the original client.   Interface   - A live animated portrait of your character now appears beside the HP and MP bars.   - The client now ships with its own Tahoma and Noto Sans fonts, allowing text to work across languages. Chat and nameplate fonts can be selected in the new Fonts settings section.   - The target window has been refined — clicking the level chip now expands or collapses the window.   - NPC dialog windows have received additional polish, including proper window titles and button labels. Download from the launcher you have installed or at https://updates.fermata.gg/ if you don't have the launcher
    • Damn there are still people that value Lineage! Great job Elfo as always!
    • Payment Methods Credit/Debit Card, PayPal, Wise, Payoneer, Binance Pay, Bybit, Crypto, and other supported payment options depending on availability. Delivery Time / TAT General delivery time: Instants to 24 hours Depended on Products. Some products may take longer depending on stock, account eligibility, product type, payment confirmation, or activation requirements. Refund & Replacement Policy If we cannot deliver the product within the confirmed delivery time and you do not want to wait, you are eligible for a refund. If the account, gift link, gift code, or activation does not work at first login/activation, please contact us within 24 hours with screen recording proof before start purchasing. If the product is successfully delivered and activated, refund is not available unless a specific warranty was mentioned for that product. Warranty period depends on the product type. Some products may include replacement support for a limited period. Please ask before ordering if warranty is important. No refund/replacement is available if the buyer shares account details, changes recovery/security settings without asking, uses VPN/proxy in a risky way, violates platform rules, fails to provide proof, or changes their mind after successful use. If a platform changes its policy, eligibility, country availability, or subscription system after delivery, we will try to help, but we cannot control third-party platform changes. Important Notes Stock may be limited for some products at klouditem. Prices may change depending on market, stock, and product availability. Some services may require your personal email/account for upgrade. Some services are ready-made accounts only. Some products may have country or account eligibility requirements. Please read the product details before ordering. We do not claim to be an official partner of any platform unless clearly stated by the platform itself. Product names and logos belong to their respective owners. Review Copies Review copies are not always available. If we open a review copy round, we will announce it in this thread and select qualified members based on account history, activity, and availability. Please do not request review copies unless we have announced them. FAQ Q: Do you deliver instantly? A: Delivery is usually Instant to 24 hours, depending on stock and payment confirmation. Q: Can I upgrade my own account? A: Some services support own account upgrade, while others are ready-made account only. Please ask before ordering. Q: Do you provide support after delivery? A: Yes, we provide support for login, activation, and basic setup issues related to the delivered product. Q: Can I check stock before payment? A: Yes, please ask before payment. We will confirm stock and delivery time first. Q: Are prices fixed? A: Some prices are fixed, and some depend on stock/package. Q: What should I do if I face an issue? A: Contact us as soon as possible with clear screenshot or screen recording proof from purchase, and we will check it.   Contact Buy Now: https://klouditem.com Telegram Support: https://t.me/Klouditem
    • https://prnt.sc/MCxO-vS1MHuA how to zoom in? and on every click ad popup.. nonsense.
  • Topics

×
×
  • Create New...

Important Information

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..