Jump to content

Question

Posted

Hi,

I am using L2jserver files. Latest revision ( Beta ). DP:10079 L2J:6317

This is the script im trying to make it work.
GS dont show any errors.. And then i kill barakiel it wont give me nobless.
Yes i killed it with subclass and writen path to scripts.cfg

Help please. Thanks in advice.

/*
 * 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 custom.Nobless;

import com.l2jserver.gameserver.model.L2CommandChannel;
import com.l2jserver.gameserver.model.L2Party;
import com.l2jserver.gameserver.model.actor.L2Npc;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.quest.Quest;
import com.l2jserver.gameserver.model.quest.QuestState;
import com.l2jserver.gameserver.model.quest.State;

/**
 * 
 * @author mochitto
 *
 */
public final class Noblesse extends Quest
{
	private static final String QN = "Noblesse";
	private static final int BARAKIEL = 25325;
	private static final int NOBLESS_TIARA = 7694;
	private static final String[] PARTS = 
	{
		"Q00241_PossessorOfAPreciousSoul_1",
		"Q00242_PossessorOfAPreciousSoul_2",
		"Q00246_PossessorOfAPreciousSoul_3",
		"Q00247_PossessorOfAPreciousSoul_4"
	};

	@Override
	public final String onKill(L2Npc npc, L2PcInstance player, boolean isPet)
	{
		if( getId() != BARAKIEL )
			return null;
		L2CommandChannel cmd = null;
		
		L2Party party = player.getParty();
		
		if (party != null)
			cmd = player.getParty().getCommandChannel();
		
		if (cmd != null)
		{
			for (L2PcInstance partyMember : cmd.getMembers())
			{
				if(!partyMember.isNoble() && partyMember.isSubClassActive())
				{					
					for(String q : PARTS)
					{
						QuestState st = partyMember.getQuestState(q);
						if (st != null)
						{
							st.setState(State.COMPLETED);
							st.exitQuest(false);
						}
					}					
					partyMember.setNoble(true);
					partyMember.sendMessage("Congratulations. You are now Noblesse.");
					partyMember.addItem("Custom nobless", NOBLESS_TIARA, 1, null, true);
					_log.info("Noblesse: Player "+partyMember+" get nobless.");
				}
			}
		}
		else if (party != null)
		{
			for (L2PcInstance partyMember : party.getMembers())
			{
				if(!partyMember.isNoble() && partyMember.isSubClassActive())
				{					
					for(String q : PARTS)
					{
						QuestState st = partyMember.getQuestState(q);
						if (st != null)
						{
							st.setState(State.COMPLETED);
							st.exitQuest(false);
						}
					}					
					partyMember.setNoble(true);
					partyMember.sendMessage("Congratulations. You are now Noblesse.");
					partyMember.addItem("Custom nobless", NOBLESS_TIARA, 1, null, true);
					_log.info("Noblesse: Player "+partyMember+" get nobless.");
				}
			}
		}
		else
		{
			if(!player.isNoble() && player.isSubClassActive())
			{					
				for(String q : PARTS)
				{
					QuestState st = player.getQuestState(q);
					if (st != null)
					{
						st.setState(State.COMPLETED);
						st.exitQuest(false);
					}
				}					
				player.setNoble(true);
				player.sendMessage("Congratulations. You are now Noblesse.");
				player.addItem("Custom nobless", NOBLESS_TIARA, 1, null, true);
				_log.info("Noblesse: Player "+player+" get nobless.");
			}
		}
		
		return super.onKill(npc, player, isPet);
	}
	
	public Noblesse(int questId, String name, String descr)
	{
		super(questId, name, descr);
		addKillId(BARAKIEL);
	}
	
	public static void main(String[] args)
	{
		new Noblesse(-1, QN, "custom");
	}
}


6 answers to this question

Recommended Posts

  • 0
Posted

Try to debug it, check if constructor is being used, after that if onKill(L2Npc,L2PcInstance,boolean) is run after death of barakiel. I think player that made last kill on barakiel, needs to have this "Nobless" quest with ID -1 already started(or in l2jserver this quest will be somehow global, i am not sure).

  • 0
Posted

Try to debug it, check if constructor is being used, after that if onKill(L2Npc,L2PcInstance,boolean) is run after death of barakiel. I think player that made last kill on barakiel, needs to have this "Nobless" quest with ID -1 already started(or in l2jserver this quest will be somehow global, i am not sure).

How can i check that ? GS shows nothing.. What u mean , i have to check if script even reacting to barakiel killing or not. This was my first idea,but since i dont know how to check that thing.. :]

  • 0
Posted

Try changing this line

 

-if(getId() != BARAKIEL)
+if(npc.getId() != BARAKIEL)

Thanks.. Working now.

L2j always changes core methods.. So stupid.

  • 0
Posted (edited)

If you want possible simples debugging, just put System.out.println("something blabla"); to part of the codes and watch gameserver console if it will appear.

Something a lot more advanced is debugging gameserver bat in real time. Add "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005" after word "java " in StartGameServer.bat. Then you need to configurate Remote debugging option in your IDE, set host as localhost and port as 5005. Then when gameserver is running, you can start debugging it. All you have to do is set up break points, they will show you everything.

Edited by vampir
Guest
This topic is now closed to further replies.


  • Posts

    • https://web.archive.org/web/20260306183214/https://maxcheaters.com/topic/241828-l2j-l2damage/page/3/ https://l2topzone.com/forum/l2-server-support-problems/9/l2damage-stopped/30514 Also we will try to push longer seasons ever ! (1135-100)/9 = 115 online
    • ONE SIDE – AND EVERYTHING BREAKS ▪ Looks like a simple case: Florida DL, back side, barcode – “clean and minimal”. ▪ In reality, these are exactly the tasks that fail most often. – data provided as plain text – request only for the back side – focus on the barcode (PDF417) ▪ And here’s the key point: ▪ A barcode is not just a “picture on the back”. It’s compressed logic of the entire document. ▪ If it doesn’t match the front, format, and data structure – the system flags it instantly. ▪ Many create a “similar-looking” code. But systems don’t read “similar” – they read by specification. ▪ In cases like this, it’s not about design. It’s about correct data assembly and how it behaves inside the format. ▪ Today only – 15% off for verification cases. ▪ Want it to pass, not just look right? Describe your case – we’ll show where even clean files break. › TG: @mustang_service ( https:// t.me/ mustang_service ) › Channel: Mustang Service ( https:// t.me/ +JPpJCETg-xM1NjNl ) #editing #photoshop #documents #verification #case
    • Your anonymity is a corpse. Blockchain forgets nothing. Your transactions are direct footprints in the hands of anyone who takes an interest. [✘] Still believe in "mixing"? Forget it. Classic Bitcoin mixers are an illusion of security. For Chainalysis and Elliptic algorithms, any attempt to hide tracks in the ledger is transparent. Your "mixing" is an artifact that gets filtered out in seconds. Every transaction leaves a trail that leads to frozen assets or unwanted questions from exchanges.  We don't mix. We break the link. [-] Input: Your "dirty" coins (Dirty BTC/ETH) with all their history and digital markers stay with us. [+] Output: You receive absolutely clean assets (Clean Crypto) from our reserves, which have never intersected with your past. This isn't a game of hide and seek. This is the surgical removal of your financial history from the system.   ------------------------------------------------------------------- Technical indexing: Bitcoin Mixer, Crypto Mixer, Clean BTC, Clean ETH, Anti-Chainalysis, Best Bitcoin Mixer, Anonymous Crypto Exchange, NoLog Mixing Service.
    • Here you are: https://l2crypt.com/l2-tools/l2editor-source/
  • 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..